3
我試圖在linux或unix系統上得到類似「樹」命令的行爲,其中函數返回完整路徑中的目錄列表或數組。如何在PHP中遞歸地返回完整路徑的目錄?
例
~/
~/Pictures
~/Movies
~/Downloads
~/Documents
~/Documents/work
~/Documents/important
~/Documents/bills
~/Music
~/Music/80s/
等....等...
使用此功能的問題是,它不返回空目錄。也是必要的getPathname()?我試過沒有,它似乎很好地工作?再次感謝! :) – chutsu 2011-05-16 14:45:37
看到我的更新。當然,不需要使用getPathname()。 – akond 2011-05-16 17:09:43
這產生點文件奇怪,因爲我認爲標誌SKIP_DOTS是RecursiveDirectoryIterator的默認值? – Titan 2015-05-01 13:44:05