In any directory there are many files and directories. In order to show them we use opendir() function. Consider the following example :
<?php if ($handle = opendir('.')) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { ?> <a href="<?php echo "$entry"; ?>" > <?php echo "$entry"; echo "<br />" ?> </a> <?php } } closedir($handle); } ?>
Following output will be produced :
