...

View Full Version : Readdir arranged into a table.



twistie.man
05-03-2006, 10:35 PM
I've been programmin PHP for over two years now and I've only just realised I don't know how to do something! Iam currently retreiving all the conetnts of a folder using readdir. I want to be able to arrange all these files into a table three columns wide but I don't know how!

I want it to be like this:

1|2|3
4|5|6
7|8|9

Can anyone help?

ralph l mayo
05-04-2006, 06:39 AM
Not readdir, but it should be similar:


$files = glob('*');

for ($i = 0; $i < count($files); ++$i)
{
echo $files[$i];
echo (($i + 1) % 3 && $i != count($files) - 1) ? '|' : '<br />';
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum