0
我在我的目录中有6张图片。他显示2个图像和1个文件名。文件名是错误的,但他在目录中,但他没有显示该图像。你可以帮我吗?我希望他显示2张图片+ 2个正确的文件名。文件名错误
<!DOCTYPE html>
<?php
//path to directory to scan
$directory = "images1/";
//get all image files with a .jpg extension.
$images = glob($directory . "*.jpg");
shuffle($images);
?>
<html>
<meta http-equiv="refresh" content="60" >
<head>
<title>Image</title>
</head>
<body>
<ul>
<?php
for($i=0;$i<2;$i++)
echo"<img src=\"$images[$i]\"width=\"300\"height=\"400\">";
echo basename($images[$i], ".jpg");
?>
</ul>
</body>
</html>
您可以张贴输出吗? – cIph3r 2013-02-19 18:32:31
将括号中的'for'括起来 – 2013-02-19 18:32:54