PHP遍历目录之一
时间:2005-02-01 来源:bugi
function dirtree($path=".") { echo " "; $d = dir($path); while(false !== ($v = $d->read())) { if($v == "." || $v == "..") continue; $file = $d->path."/".$v; if(is_dir($file)) { echo " $v"; dirtree($file); } else echo " $v"; } $d->close(); echo " "; } dirtree("d:g"); ?>
function dirtree($path=".") { echo " "; $d = dir($path); while(false !== ($v = $d->read())) { if($v == "." || $v == "..") continue; $file = $d->path."/".$v; if(is_dir($file)) { echo " $v"; dirtree($file); } else echo " $v"; } $d->close(); echo " "; } dirtree("d:g"); ?>
function dirtree($path=".") { echo " "; $d = dir($path); while(false !== ($v = $d->read())) { if($v == "." || $v == "..") continue; $file = $d->path."/".$v; if(is_dir($file)) { echo " $v"; dirtree($file); } else echo " $v"; } $d->close(); echo " "; } dirtree("d:g"); ?>
相关阅读 更多 +