1
php echo file names from directory
This will display the entire contents of a directory... including: ".", "..", any sub-directories, and any hidden files.
CGuild1.com > Tips & Tricks > php echo file names from directory

How to echo files names from a directory using PHP

<?php
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            echo $file;
        }
        closedir($handle);     }
?>


I found this over here at Stackoverflow.
©2024 CGuild1.com