看板 PHP 關於我們 聯絡資訊
<?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)
pakker:一直重新open當然一直重頭讀起阿 12/17 22:38
yorjing:謝謝大大指點 12/17 22:41