PHP list directory content


SUBMITTED BY: Guest

DATE: Oct. 23, 2013, 9:12 a.m.

FORMAT: PHP

SIZE: 467 Bytes

HITS: 1101

  1. <?php
  2. function list_directory_content($dir){
  3. if(is_dir($dir)){
  4. if($handle = opendir($dir)){
  5. while(($file = readdir($handle)) !== false){
  6. if($file != '.' && $file != '..' && $file != '.htaccess'){
  7. echo '<a target="_new" href="'.$dir.$file.'">'.$file.'</a><br>'."\n";
  8. }
  9. }
  10. closedir($handle);
  11. }
  12. }
  13. }
  14. ?>

comments powered by Disqus