mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-07-25 17:13:08 +00:00
21 lines
427 B
PHP
21 lines
427 B
PHP
<?php
|
|
function recursion_dir($path)
|
|
{
|
|
static $depth = 0;
|
|
|
|
$dir = opendir($path);
|
|
while (($file = readdir($dir)) !== false) {
|
|
if ($file == '.' || $file == '..' ) continue;
|
|
echo str_repeat('-', $depth)." $file<br />";
|
|
|
|
if (is_dir("$path/$file")) {
|
|
$depth++;
|
|
recursion_dir("$path/$file");
|
|
$depth--;
|
|
}
|
|
}
|
|
closedir($dir);
|
|
}
|
|
|
|
recursion_dir('.');
|