Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. <?php
  2. $dir = new RecursiveDirectoryIterator(getcwd());
  3. $files = new RecursiveIteratorIterator($dir);
  4. $files_sorted = array();
  5. foreach($files as $path) {
  6. array_push($files_sorted, substr($path, strlen(getcwd()), strrpos($path, "\\")-strlen(getcwd())));
  7. }
  8. $files_sorted = array_unique($files_sorted);
  9. foreach($files_sorted as $dir) {
  10. echo $dir . "<br>";
  11. }
  12. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement