Hi, i was trying to show all the images from a folder and i just got the code and it works just fine, but the problem is the images were displayed horizontally making the height of my site stretch and leaving big space on the left and right side of it. Now what i want to do is simply insert all the images on a table and per row there is a 6 column it mean 6 images per column and of course i want all the images on that particular folder fill the table. I have the code below which gives me correct output of displaying 6 columns in a row but the problem is when i tried to insert the image only the 1st image from the folder is showing. I know the answer is just there but i cant simply find it
here is the code i hope someone can help me:
<?php
$files = glob("../portfolio/banners/.");
for ($i=1; $i<count($files); $i++)
$num = $files[$i];
$vals = range(1, $i);
$rows = array_chunk($vals,6); //3 = #of cols
{
echo '<table border="2">';
foreach($rows as $row) {
echo '<tr>';
foreach($row as $col) {
echo '<td align="center"><img src="'.$num.'" alt="random image" width="60" height="60"></td>';
}
echo '</tr>';
}
echo '</table>';
}
?>
pls. take a look at my site so you can see what i mean:
http://www.7angels.info/portfolio/
thanks in advance for those who can help me.