I have this script:
<?php
$count = 0;
foreach(glob("images/{*.gif,*.jpg,*.png,*.jpeg,*.bmp}", GLOB_BRACE) as $image)
while ($image)
{
if($count==3)
{
print "</tr>";
$count = 0;
}
if($count==0)
print "<tr>";
print "<td>";
?>
<img src="<?php echo $image;?>" width="80" height="80"/>
<?php
$count++;
print "</td>";
}
if($count>0)
print "</tr>";
?>
It supposed to take the images from a folder ("images" in this case) and display them 3 on a row. But it displays one picture 1000000 times. What cand I do to fix this? I tried to fix it, all I know is that the problem is at the "while" line.
while($image)
– fedorqui 'SO stop harming' Feb 25 '13 at 15:51