glob(), sorting by length/name

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

glob(), sorting by length/name

Post by JKM »

Hi there,

I've got a folder with some images, named 1,2,3,4,5,6,7...2000. Now, with glob() - for listing the images - it's listed like this:
1
10
100
1000
1001
etc.

How do I list it like this:
1
2
3
4
5
etc.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: glob(), sorting by length/name

Post by requinix »

glob() followed by natsort.
Post Reply