Sort an array:
The natsort() function sorts an array by using a "natural order" algorithm. The values keep their original keys.
In a natural algorithm, the number 2 is less than the number 10. In computer sorting, 10 is less than 2, because the first number in "10" is less than 2.
Parameter | Description |
---|---|
array | Required. Specifies the array to sort |
Return Value: | Returns TRUE on success, or FALSE on failure. |
---|---|
PHP Version: | 4+ |
Changelog: | As of PHP 5.2.10, Zero padded numeric strings (e.g., '00006') now ignore the 0 padding |