Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dir = new RecursiveDirectoryIterator(getcwd());
- $files = new RecursiveIteratorIterator($dir);
- $files_sorted = array();
- foreach($files as $path) {
- array_push($files_sorted, substr($path, strlen(getcwd()), strrpos($path, "\\")-strlen(getcwd())));
- }
- $files_sorted = array_unique($files_sorted);
- foreach($files_sorted as $dir) {
- echo $dir . "<br>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement