【发布时间】:2013-12-27 09:22:41
【问题描述】:
我知道它正在访问该目录,因为那里有正确数量的损坏图标。即使alt='Image not there' 也不起作用,它只会扩大其所在的元素,但不显示任何文本。我尝试了其他脚本,它显示了alt='Image not there',但仍然给出了一个损坏的图像图标。我还尝试简单地从文件夹中回显图像,但图像图标仍然损坏,那我做错了什么?它甚至是脚本还是发生了什么?
<?php
$dirname = "C:/uploads/";
$images = scandir($dirname);
shuffle($images);
$ignore = Array(".", "..");
foreach ($images as $curimg) {
if (!in_array($curimg, $ignore)) {
echo "<li><a href='".$dirname.$curimg."'>
<img src='img.php?src=".$dirname.$curimg."&w=300&zc=1' alt='Image not working' /></a></li>\n ";
}
}
?>
【问题讨论】:
-
尝试使用相对路径显示图片目录/文件