Showing posts with label All Files name from folder PHP. Show all posts
Showing posts with label All Files name from folder PHP. Show all posts

Sunday, 28 August 2016

How to fetch all files name from folder in PHP


Fetch all files name from folder in PHP

    if ($handle = opendir("C:\wamp\www\yoursite/download/")) {

            while (false !== ($entry = readdir($handle))) {
                if ($entry != "." && $entry != "..") {
                   
                        echo "<b>".preg_replace('/\\.[^.\\s]{3,4}$/', '', $entry)."</b>";
                   
                }
            }

        closedir($handle);
    }

Thats it.... Enjoy Chandresh rana's Coding... :)