php code help website?

  • Thread starter Thread starter HWD
  • Start date Start date
H

HWD

Guest
ignore the iframe tag accidentally posted on the top
This is the php code that lists all of the files in its directory (other that dot-files and index.php). The files are al named like this:
file_number_1.html
example_number_2.html
...etc...
i need to modify the script below so that it strips of the ".html" and the underscores in the file name.

<iframe src="comments/index.php" width="100%" height="500"><?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && $file != "index.php")
{
$thelist .= '<a href="'.$file.'">'.$file.'</a><br>';
}
}
closedir($handle);
}
?>
 
Back
Top