I have an array that I wish to sort, it contains images with file extensions, the filename is numeric and the file extension is obviously a string.
$files = array();
$files[] = '4.jpg';
$files[] = '14.jpg';
$files[] = '1.jpg';
$files[] = '44.jpg';
If i use sort() then I end up with the following:
sort($files);
print_r($files);
Array
(
[0] => 1.jpg
[1] => 14.jpg
[2] => 4.jpg
[3] => 44.jpg
)
What i actually want is:
Array
(
[0] => 1.jpg
[1] => 4.jpg
[2] => 14.jpg
[3] => 44.jpg
)
Is this possible?