HI There! This has been bothering me for ages! I need to know how to use 2 STR_REPLACE codes on one page - I need to get rid of 2 bits in my file names _ & .zip
I got rid of the _ using this code
<?
function listroms($system, $letter) {
if ($handle = opendir("roms/$system")) {
while (false !== ($rom = readdir($handle))) {
if ($rom != "." && $rom != ".." && $rom[0] == $letter) {
$isfile = "TRUE";
$rom2 = str_replace("_", " ", $rom);
echo "<div align=\"center\"><center><table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\" id=\"AutoNumber1\"><tr><td width=\"100%\"><a href=\"index.php?page=download4&system=$system&rom=$rom\">$rom2</a><BR></td></tr></table></center></div>";
}
}
closedir($handle);
}
if ($isfile != "TRUE") {
echo "Sorry we have no roms for $system beginning with the letter $letter.<BR>";
}
} // end function listroms
?>
<b>Emulation Now <? echo $system ?> ROMS for the letter <? echo $letter ?></b><BR><BR>
<? listroms($system, $letter); ?>
But I can't get rid of the .zip ? would anyone know how to add it in? Thanks in Advance🙂 Andy