A directory traversal function
function dirtree($path="./test") {
echo "
";
$d = dir($path);
while (false !== ($v = $d->read())) {
if($v == "."
$v == "..")
continue;
$file = $d->path."/".$v;
echo "- $v";
if(is_dir($file))
dirtree($file );
}
$d->close();
echo "
";
}
dirtree();
?>
http://www.bkjia.com/PHPjc/314378.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314378.htmlTechArticleA directory traversal function?php function dirtree($path="./test") { echo "dl"; $d = dir($path); while(false !== ($v = $d-read())) { if($v == "." $v == "..") continue; $file = $d-path."...