Advertisement
Guest User

George

a guest
Jan 31st, 2008
2,767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>List of files</title>
  4. </head>
  5. <body>
  6. <?php
  7. $thelist = array();
  8. $dir = './';
  9. if ($handle = opendir($dir)) {
  10.     while (false !== ($file = readdir($handle))) {
  11.         if ($file != "." && $file != "..") {
  12.             $file = $dir.$file;
  13.             $thelist[] = array('file' => $file, 'filemtime' => filemtime($file), 'filesize' => filesize($file));
  14.         }
  15.     }
  16.  
  17.     closedir($handle);
  18. }
  19. ?>
  20. <p>
  21. <table><tr><td><strong>File name</strong></td><td><strong>File Size</strong></td><td><strong>File Last Modification Time</strong></td></tr>
  22. <?php
  23. for($i = 0; $i < count($thelist); $i++) {
  24.     ?><tr><td><?=$thelist[$i]['file']?></td><td><?=$thelist[$i]['filesize'];?></td><td><?=$thelist[$i]['filemtime'];?></td></tr><?php
  25. }
  26. ?>
  27. </table>
  28. </p>
  29.  
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement