<?php //直接遍历所有文件.递归 function trees($dirname){ $dirOb = dir($dirname); echo "<ul>\n"; while($file = $dirOb->read()){ if($file == "." || $file == ".."){ }else{ if(is_dir("$dirname/$file")){ echo "<li><font color=\"#ff00cc\"><b>$file</b></font></li>\n"; trees("$dirname/$file"); }else{ echo "<li>$file</li>\n"; } } echo "<br/>"; } echo "</ul>\n"; } trees("../tp5");
时间: 2024-10-13 15:52:10