Here it is
Code:
<?php
if($dir = opendir(".")) {
while (($file = readdir($dir)) !== false) {
if($file != "." && $file != ".." &&
$file != basename(__file__) &&
preg_match("/^.*\.php$/",$file)) {
$text .= "<a href=\"$file\">";
$text .= str_replace("-"," ",str_replace(".php","",$file));
$text .= "</a><br>\n";
}
}
}
$fd = fopen("outputfile.html","w");
fwrite($fd,$text);
fclose($fd);
echo "Job done";
?>
Modifyed it to only look for .php files and exclude itself
also removed the ".php" from the title