$string="";
$fileCount=0;
$filePath=$PATH.'/var/www/public_html/'; # Specify the path you want to look in.
$dir = opendir($filePath); # Open the path
while ($file = readdir($dir)) {
if (eregi("\.php",$file)) { # Look at only files with a .php extension
$string .= "$file
";
$fileCount++;
}
}
if ($fileCount > 0) {
echo sprintf("List of Files in %s
%sTotal Files: %s",$filePath,$string,$fileCount);
}
No comments:
Post a Comment