Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php
  2. $dir = '~/public_html/files';
  3. $dp = opendir($dir);
  4. $files = array();
  5. if ($dp) {
  6. while ($file = readdir($dp)) {
  7. if (is_dir("$dir$file")) {
  8. $innerdp = opendir("$dir$file");
  9. if ($innerdp) {
  10. while ($innerfile = readdir($innerdp)) {
  11. $files[$file][] = $innerfile;
  12. }
  13. }
  14. }
  15. }
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement