$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("\.htm",$file)) { $string .= "$file
"; $fileCount++; } }