PHP 4, PHP 5, PHP 7, PHP 8
natcasesort - Sort an array using a case insensitive "natural order" algorithm

natcasesort( arrayarray ): bool

natcasesort is a case insensitive version of natsort.

This function implements a sort algorithm that orders alphanumeric strings in the way a human being would while maintaining key/value associations. This is described as a "natural ordering".


If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined.


Resets array's internal pointer to the first element.



The input array.

Return Values

Always returns true.

Related Functions

Example of natcasesort

Show all examples for natcasesort

PHP Version:

Function natcasesort:

Arrays Functions

Most used PHP functions