[請益] 關於開某個資料夾下的資料夾裡的檔案?

看板PHP作者 (托兒所嬰兒)時間18年前 (2007/12/17 22:33), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/2 (看更多)
<?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
一直重新open當然一直重頭讀起阿
12/17 22:38, 1F

12/17 22:41, , 2F
謝謝大大指點
12/17 22:41, 2F
文章代碼(AID): #17PeYV47 (PHP)
文章代碼(AID): #17PeYV47 (PHP)