для затравки
define("SEP", "· ");
$dir = ".";
echo $dir."<br/>";
function recursive_directory_traversal($dir, $sep) {
$files = array_diff(scandir($dir), array(".", ".."));
foreach($files as $value) {
if (empty($files)) continue;
$path = $dir."/".$value;
if (is_dir($path)) {
echo $sep."<b>".$value."</b><br/>";
recursive_directory_traversal($path, $sep.SEP);
} else {
echo $sep.$value."<br/>";
}
}
}
recursive_directory_traversal($dir, SEP);