Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. function listdir($dir)
  2. {
  3.   if($dh = opendir($dir))
  4.   {
  5.     while(($file = readdir($dh)) !== false)
  6.     {
  7.       /* Ignore anything that starts with a period. */
  8.       if($file[0] == '.') continue;
  9.       if(!strcmp($file, "README.html")) continue;
  10.  
  11.       $isdir = is_dir($dir."/".$file);
  12.       $size  = ($isdir ? 0 : filesize($dir."/".$file));
  13.  
  14.       $list[] = array(
  15.         'name'    => $file,
  16.         'isdir'   => $isdir,
  17.         'size'    => $size,
  18.         'date'    => filemtime($dir."/".$file),
  19.         'comment' => read_comment($dir, $file)
  20.       );
  21.     }
  22.  
  23.     closedir($dh);
  24.   }
  25.  
  26.   return($list);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement