Re: Using Arrays in PHP hi,
Here we see use of strcmp() function.
strcmp -- Binary safe string comparison
Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
For example:
$arr = array("img12.png", "img10.png", "img2.png", "img1.png");
usort($arr, "strcmp");
print_r($arr);
//output
Array
(
[0] => img1.png
[1] => img10.png
[2] => img12.png
[3] => img2.png
)
--kamal. |