看板 PHP 關於我們 聯絡資訊
各位版友: 這是我的程式碼: <? $path = "test1" ; echo "Directory Listing of $path<br><br>"; function read_dir($path) { echo $path."<br>"; $df=opendir($path); while($file = readdir($df)) { if($file !='.' && $file !='..') if(is_dir($path.'/'.$file)) { echo "<font color = red> $file </font><br>"; return read_dir($path.'/'.$file); } else { echo $path.'/'.$file."<br>"; } } closedir($df); } read_dir($path); ?> 我的目錄結構: test1---t1---t3 | | | ---text.txt ---text.txt | ---t2---text.txt 但是我的執行結果 只會執行 t1 t1/t3 這樣子,不然我希望的是其他的也能夠被處理,但是不知道要怎麼做 請高手們給我方向 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.160.62.82
chph :scandir() 01/02 15:12