SHARE
TWEET

Untitled

a guest Feb 27th, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top