I have a number of files I am loading into a slideshow, I have them numbered by the client in the order that they'd like to be displayed.
I'm grabbing them with glob $pics = glob("images/slideshow/*.jpg", GLOB_NOSORT); but for some reason I'm getting the old Windows sorting bug, of 11 being sorted above 2.
For example,
Array
(
[0] => images/slideshow/1.jpg
[1] => images/slideshow/14.jpg
[2] => images/slideshow/15.jpg
[3] => images/slideshow/16.jpg
[4] => images/slideshow/18.jpg
[5] => images/slideshow/2.jpg
[6] => images/slideshow/20.jpg
[7] => images/slideshow/21.jpg
[8] => images/slideshow/22.jpg
[9] => images/slideshow/23.jpg
[10] => images/slideshow/24a.jpg
[11] => images/slideshow/25.jpg
[12] => images/slideshow/26.jpg
[13] => images/slideshow/29.jpg
[14] => images/slideshow/3.jpg
[15] => images/slideshow/36.jpg
[16] => images/slideshow/38.jpg
[17] => images/slideshow/4.jpg
[18] => images/slideshow/40.jpg
[19] => images/slideshow/41.jpg
[20] => images/slideshow/5.jpg
[21] => images/slideshow/6.jpg
[22] => images/slideshow/7.jpg
)
I've run it through asort() and I can't seem to find out why this isn't working, short of it being something about them being strings, rather than strictly numbers.