PHP script listing file directory
Issue
Hello,
I am looking for a script which will give a list of files in a directory!
How can I do this??
Solution
You can use this:
function AffDir($rep)
{
$dir = opendir($rep);
while ($File = readdir($dir))
{
if($File != "." && $File != "..")
{
echo $File."<br>";
}
}
closedir($dir);
}
AffDir(".");
See also
Knowledge communities.