sort array numerically
hi folks, i am using glob("Data/small/*.jpg") to get a list of images in a folder and store in an array. it gives me a list as follows:
what i want is to sort the array numerically i.e. 1.jpg should come on top. i have trid sort() as well as asort() functions with different flags but no encouraging results
Try the natsort() function.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
thanx alot. i will try it....
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread