ArrayObject natcasesort() Function in PHP Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share 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: https://www.php.net/manual/en/arrayobject.natcasesort.php Comment More infoAdvertise with us Next Article ArrayObject uasort() Function in PHP G 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 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 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 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 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 Like