What kind of looping ?

From: Date: Tue, 27 Nov 2001 21:11:23 +0000
Subject: What kind of looping ?
Groups: php.general 
Request: Send a blank email to php-general+get-75811@lists.php.net to get a copy of this message
Hey guys, I cant figure out what functions and/or looping I need to use for what I need to do. Im reading a directory and pushing all the file names in the directory into an arrary. I want to be able print out each element(file name) in the array into an HTML table while limiting a certain number of elements for each row. Example: $image_dir = opendir("../images/bullets/"); while ($file = readdir($image_dir)) { $file_list[] = $file; }; Now $file_list[] has some number a file names. I want print 4 file names into a row. Each file name has to be in its on cell. <table> <tr> <td>FILE 0</td> <td>FILE 1</td> <td>FILE 2</td> <td>FILE 3</td> </tr> <tr> <td>FILE 4</td> <td>FILE 5</td> <td>FILE 6</td> <td>FILE 7</td> </tr> </table> I would image I would use a for loop, but I cant figure it out. Can somone assist me ? Thanks, Steve

« previous php.general (#75811) next »