我有这个脚本:
<?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>";
?>
它应该从文件夹中获取图像(在本例中为“图像”)并连续显示 3 张。但它显示一张图片 1000000 次。我能做些什么来解决这个问题?我试图修复它,我只知道问题出在“while”行。