[請益] 關於開某個資料夾下的資料夾裡的檔案?
<?php
$handle=opendir('.');
echo "Directory handle: $handle\n";
echo "Files:\n";
while ($file = readdir($handle)) {
if(is_dir($file))
{
if($file!="Thumns.db"){
if(substr($file,0,1)!=".")
{
echo "<br>資料夾:".$file;
while ($innerfile = readdir(opendir(".\\".$file))) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
我猜大概是這行的問題吧....
請問大大 這行要怎麼寫比較好?
if(substr($file,0,1)!="."){
if($innerfile!="Thumns.db"){
echo "<br>檔案:".$innerfile;
}
}
}
}
}
}
}
closedir($handle);
?>
這是我的程式碼
我想把某資料夾的所有資料夾裡的所有檔案
檔名跟資料夾名稱列出來
不料卻無線迴圈
可以請問各位大大有辦法解決嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.217.236.54
※ 編輯: yorjing 來自: 61.217.236.54 (12/17 22:34)
※ 編輯: yorjing 來自: 61.217.236.54 (12/17 22:37)
推
12/17 22:38, , 1F
12/17 22:38, 1F
→
12/17 22:41, , 2F
12/17 22:41, 2F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
154
159