When I use the following code:
Code:
<?php
    // site template
    include("header.php");
    include("toppage.php");
    // display the information to be previewed
    $oldcontent = $updatecontent;
    $oldcontent = eregi_replace("\[i\]","<span class=\"italic\">",$oldcontent);
    $oldcontent = eregi_replace("\[/i\]","</span>",$oldcontent);
    $oldcontent = eregi_replace("\[b\]","<span class=\"bold\">",$oldcontent);
    $oldcontent = eregi_replace("\[/b\]","</span>",$oldcontent);
    $oldcontent = eregi_replace("\[u\]","<span class=\"underline\">",$oldcontent);
    $oldcontent = eregi_replace("\[/u\]","</span>",$oldcontent);
    $oldcontent = eregi_replace("\[list\]","<ul>",$oldcontent);
    $oldcontent = eregi_replace("\[/list\]","</ul>",$oldcontent);
    $oldcontent = eregi_replace("\[\*\]","<li>",$oldcontent);
    $oldcontent = eregi_replace("\[/\*\]","</li>",$oldcontent);
    $oldcontent = eregi_replace("\[space/\]","&nbsp;",$oldcontent);
    $oldcontent = str_replace('\"','"',$oldcontent);
    echo($oldcontent);
    $newcontent = "<br />\n<br />\n
    <form action='$PHP_SELF' method=\"post\">\n
    <input type=\"hidden\" name=\"updateid\" value='$updateid' />\n<br />\n
    <input type=\"hidden\" name=\"updatedate\" value='$updatedate' />\n
    <p>$updatedate</p>\n
    <table width=\"670\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n<tr>\n
    <td width=\"200\" align=\"left\" valign=\"top\"><p>Title:</p></td>\n
    <td width=\"470\" align=\"center\" valign=\"top\"><input type=\"text\" name=\"updatetitle\" size=\"63\" value='$updatetitle' /></td>\n</tr>\n<tr>\n
    <td width=\"670\" colspan=\"2\" align=\"left\" valign=\"top\"><p>Content:</p></td>\n</tr>\n<tr>\n
    <td width=\"670\" colspan=\"2\" align=\"center\" valign=\"top\"><textarea name=\"updatecontent\" cols=\"80\" rows=\"10\" wrap>$updatecontent</textarea></td>\n</tr>\n<tr>\n
    <td width=\"670\" colspan=\"2\" align=\"left\" valign=\"top\"><p>&nbsp;</p></td>\n</tr>\n<tr>\n
    <td width=\"670\" colspan=\"2\" align=\"center\" valign=\"top\"><input type=\"submit\" value=\"Update!\" name=\"submit\" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type=\"submit\" value=\"Preview\" name=\"preview\" /></td>\n</tr>\n
    </table>\n</form>\n<br />\n<br />\n
    <p><a href=\"admin_pages.php\">Back to the Site Page Manager</a><br />\n
    <a href=\"admin.php\">Back to the Administration Center</a></p><br />";
    $newcontent = str_replace('\"','"',$newcontent);
    echo($newcontent);
    include("footer.php");
?>
The str_replace();s don't seem to be working, the returned data instead has an extra \ in the code.

Any ideas?