readdir.php : readdir « File Directory « PHP






readdir.php

 
<?php
   $dh = opendir('/usr/local/apache2/htdocs/');
   while ($file = readdir($dh))
      echo "$file <br>";
   closedir($dh);
?>
  
  








Related examples in the same category

1.Listing the Contents of a Directory with readdir()
2.Procedural directory iteration