Hello,
I am listing images from folder with this code:
$imgdir = 'uploads/'.$nick.'/'; // the directory, where images are stored
$allowed_types = array('png','jpg','jpeg','gif'); // list of filetypes I want to show
$dimg = opendir($imgdir);
while($imgfile = readdir($dimg))
{
if(in_array(strtolower(substr($imgfile,-3)),$allowed_types))
{
$a_img[] = $imgfile;
sort($a_img);
reset ($a_img);
}
}
$totimg = count($a_img); // total image number
for($x=0; $x < $totimg; $x++){
echo ' <div class="malaslika" style="width:100px;height:75px"><a href="../index.php?slika='.$a_img[$x].'"><img src="../uploads/'.$nick.'/'.$a_img[$x].'" width="100" height="75" border="0" onclick="changeImg(velika, "'.$kojaslika.'.jpg")" /></a></div>';
}
Now, I want to list this in table with max 4 columns and not important how many rows.
So the thing is how to insert images from for loop into table with 4 columns?
Anyone can help? Thank you in advance.