sorting images into groups of 4

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
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

sorting images into groups of 4

Post by andylyon87 »

Hey guys

just wondering if anyone knew a way of reading the number of files in a folder and putting them into a table of four cells wide.

So say I had 16 images in a file the would be sorted into the most recently added at the top and the oldest at the bottom in a table of 4 cells wide.

Is this possible in php alone without mySQL, cos I have no idea when it comes to that.

Thanks
Andy
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There is a thread about this specifically (in n-width tables) linked to from the "Useful Posts" thread (see link in my signature.)
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

Post by andylyon87 »

well that would be great but my host doesnt have a mySQL databaseon my package.

As said above is there anyway of doing this without mySQL

sory to be a pain

Andy
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can take the logic parts away from mysql without problem. You simply need to generate a list of the files in the folder to parse. This can be done with glob() or opendir(). :?
Post Reply