HowToPlaza.com

How to wisdom from across the Internet — want to know how to do something? You may find the solution here.


How to get the current directory listing in PHP

In PHP if you want to list the files existing in the current directory, this is how you do it:

<?php
$dir=getcwd();
$dirhandle=opendir($dir);
while(false!==($thisfile=readdir($dirhandle)))
{
    print $thisfile . “<br />”;
}

AddThis Social Bookmark Button

Posted by Amrit | Tags: Uncategorized


You can leave a response, or trackback from your own site.

Leave a Reply