Commit | Line | Data |
---|---|---|
0f2a9bdd H |
1 | #!/usr/bin/php |
2 | <?php | |
3 | //You will need JSON PHP extension for this script... | |
4 | ||
5 | function recursive_scandir($path,&$dir) { | |
6 | foreach($dir as $key => $value) { | |
7 | $dir[$key] = array_flip(scandir($path.'/'.$key, 0)); | |
8 | unset($dir[$key]['.']); unset($dir[$key]['..']); | |
9 | recursive_scandir($path.'/'.$key,$dir[$key]); | |
10 | } | |
11 | } | |
12 | ||
13 | $dds = array_flip(array('dds')); | |
14 | recursive_scandir('./', $dds); | |
15 | ||
16 | //print_r($dds); //you can use this if you don't have JSON ext. | |
17 | echo json_encode($dds); |