-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdir.php
More file actions
21 lines (16 loc) · 374 Bytes
/
Copy pathdir.php
File metadata and controls
21 lines (16 loc) · 374 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
function foreachDir($path) {
$separator = DIRECTORY_SEPARATOR;
$path = $path . $separator;
if (!is_dir($path)) {return false;}
foreach(scandir($path) as $file) {
if ($file == "." || $file == "..") {continue;}
if (is_dir($path . $file)) {
foreachDir($path . $file);
} else {
echo '<pre>';
echo $path . $file . "\n";
}
}
}
foreachDir(__DIR__);