February 2013
Intermediate to advanced
538 pages
20h 55m
English
natsort
bool natsort(array array)Sorts the values of the array using “natural order”: numeric values are sorted in the manner expected by language, rather than the often bizarre order in which computers insist on putting them (ASCII ordered). For example:
$array=array("1.jpg","4.jpg","12.jpg","2,.jpg","20.jpg");$first=sort($array);// ("1.jpg", "12.jpg", "2.jpg", "20.jpg", "4.jpg")$second=natsort($array);// ("1.jpg", "2.jpg", "4.jpg", "12.jpg", "20.jpg")
Read now
Unlock full access