ArrayObject natcasesort() Function in PHP Last Updated : 22 Mar, 2019 Comments Improve Suggest changes Like Article Like Report The natcasesort() function of the ArrayObject class in PHP is used to sort the elements of the ArrayObject following a natural order case sensitive sorting algorithm. Natural ordering means to arrange the elements in a order a normal human being would do. Syntax: void natcasesort() Parameters: This function does not accepts any parameters. Return Value: This function does not returns any value. Below programs illustrate the above function: Program 1: php <?php // PHP program to illustrate the // natcasesort() function $arr = array("b" => "geeks", "d" => "are", "a" => "awesome", "e" => "YAAY"); // Create array object $arrObject = new ArrayObject($arr); // Sort the ArrayObject $arrObject->natcasesort(); // Print the sorted ArrayObject print_r($arrObject); ?> Output: ArrayObject Object ( [storage:ArrayObject:private] => Array ( [d] => are [a] => awesome [b] => geeks [e] => YAAY ) ) Program 2: php <?php // PHP program to illustrate the // natcasesort() function $arr = array("45" => "geeks", "92" => "are", "10" => "awesome"); // Create array object $arrObject = new ArrayObject($arr); // Sort the ArrayObject $arrObject->natcasesort(); // Print the ArrayObject print_r($arrObject); ?> Output: ArrayObject Object ( [storage:ArrayObject:private] => Array ( [92] => are [10] => awesome [45] => geeks ) ) Reference: http://php.net/manual/en/arrayobject.natcasesort.php Comment More infoAdvertise with us Next Article ArrayObject natcasesort() Function in PHP gopaldave Follow Improve Article Tags : Web Technologies PHP PHP-array PHP-function PHP-ArrayObject +1 More Similar Reads ArrayObject natsort() Function in PHP The natsort() function of the ArrayObject class in PHP is used to sort the elements of the ArrayObject following a natural order sorting algorithm. The natsort() function is used to sort alphanumeric strings in a order a normal human being would do. Syntax: void natsort() Parameters: This function d 2 min read ArrayObject ksort() Function in PHP The ksort() function of the ArrayObject class in PHP is used to sort the elements of the ArrayObject according to the keys. This function does not affects the association of the keys with the values, it just sorts the entries of the ArrayObject according to the Keys. Syntax: void ksort() Parameters: 2 min read ArrayObject offsetGet() Function in PHP The offsetGet() function of the ArrayObject class in PHP is used to get the value present at a specific index at the ArrayObject. Syntax: mixed offsetGet($index) Parameters: This function accepts a single parameter $index for which corresponding value will be returned. Return Value: This function re 1 min read ArrayObject offsetExists() Function in PHP The offsetExists() function of the ArrayObject class in PHP is used to whether a given offset or index is present in the ArrayObject or not. If it is present then the function returns a boolean True value otherwise it returns False. Syntax: bool offsetExists($index) Parameters: This function accepts 2 min read ArrayObject uasort() Function in PHP The uasort() function of the ArrayObject class in PHP is used to sort values of an ArrayObject according to a user defined comparison function. The function compares and arranges the values present in the ArrayObject according to the given comparison function. This method does not affects the key-va 2 min read PHP | ArrayIterator natsort() Function The ArrayIterator::natsort() function is an inbuilt function in PHP which is used to sort an array naturally. Syntax: void ArrayIterator::natsort( void ) Parameters: This function does not accept any parameters. Return Value: This function does not return any value. Below programs illustrate the Arr 1 min read ArrayObject uksort() Function in PHP The uksort() function of the ArrayObject class in PHP is used to sort the entries present in the ArrayObject according to the keys following a user-defined function. They key-value mapping is preserved after sorting the ArrayObject. Syntax: void uksort($comparator) Parameters: This function accepts 2 min read PHP natcasesort() Function The natcasesort() function is an inbuilt function in PHP which is used to sort an array by using a "natural order" algorithm. The natural order tells the order to be used as a normal human being would use. That is, it does not check the type of value for comparison. For example, in string representa 2 min read ArrayObject asort() Function in PHP The asort() function of the ArrayObject class in PHP is used to sort all of the entries of the ArrayObject according to the values. The elements are arranged according to the values keeping the maintaining the association of the keys with the value. Syntax: void asort() Parameters: This function doe 1 min read PHP array_multisort() Function The array_multisort() is an inbuilt function in PHP which is used to sort multiple arrays at once or a multi-dimensional array with each individual dimension. With this function, one should remember that string keys will be maintained, but numeric keys will be re-indexed, starting at 0 and increases 3 min read Like