我有以下代碼PHP列出圖像在文件夾
// Define the full path to your folder from root
$path = "../galleries/".$album;
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if(strlen($file)>1){echo "<a href='http://minification.com/?page_id=32&dir=$album&img=$file'><img src='http://minification.com/galleries/$album/$file'></a>";}
}
// Close
closedir($dir_handle);
我想要做的是拉從一個文件夾中的所有圖像,並使用PHP顯示它們。到目前爲止,它的工作直到只顯示文件夾中的一個圖像。有人知道怎麼修這個東西嗎?
+1專打我吧:P – 2010-08-11 15:50:46
缺少一個括號雖然 – 2010-08-11 15:51:11
嗯好的,我試過,但你可以從下面的鏈接看到它仍然只顯示1圖像 http://minification.com/?page_id = 25&album = demo%202 文件夾中至少有6個 – ChrisMJ 2010-08-11 16:03:27