I have a php page that imports a html page and displays it, I am trying to use preg_replace to remove a line at the bottom of the imported html page, heres the code I'm using:
<?
$filename = "admin/$id".".htm";
$fd = fopen ($filename , "r"
$MyStr = fread ($fd, filesize ($filename));
fclose ($fd);
$badStr = "/(<br><font size=1>generated with <a href=\" generator</a></font>)/"
$goodStr = "";
$MyStr = preg_replace($badStr, $goodStr, $MyStr);
print $MyStr;
?>
But instead it shows the html page without removing the line that I want removed and shows this error:
Warning: Unknown modifier '/' in // on line 58
Where am I going wrong?
Thanks.
<?
$filename = "admin/$id".".htm";
$fd = fopen ($filename , "r"
$MyStr = fread ($fd, filesize ($filename));
fclose ($fd);
$badStr = "/(<br><font size=1>generated with <a href=\" generator</a></font>)/"
$goodStr = "";
$MyStr = preg_replace($badStr, $goodStr, $MyStr);
print $MyStr;
?>
But instead it shows the html page without removing the line that I want removed and shows this error:
Warning: Unknown modifier '/' in // on line 58
Where am I going wrong?
Thanks.