<?php
echo "<pre>";
function getFileTree($path,$deep=0){
    $cur = basename($path);
    echo str_repeat("│".str_repeat(" ",3),$deep)."│—".$cur.PHP_EOL;
    if(is_file($path) || !file_exists($path)){
        return;
    }
    foreach(new DirectoryIterator($path) as $file){
        if($file == "." || $file == ".."){
            continue;
        }
        getFileTree($path."/".$file->getFilename(),$deep+1);
    }
}

//useag
//getFileTree("D:\inetpub\wwwali\bbs");
getFileTree(__DIR__);
?>