BigBadDave
Programmer
Why do I get a backslash after single and double quotes using this code? :
Regards
Big Bad Dave
flashtektips@hotmail.com
Code:
<?php
function myReplace($string) {
$search = array ("/ /",
"/\[b\]/",
"/\[\/b\]/",
"/\[u\]/",
"/\[\/u\]/");
$replace = array (" ",
"<b>",
"</b>",
"<u>",
"</u>");
$rstring = preg_replace ($search, $replace, $string);
return $rstring;
}
if(!@$string) {
?>
<form
method="post"
>
<textarea name="string"></textarea><br /><br />
<input type="submit" value="Go">
</form>
<?php
}
echo myReplace(nl2br(htmlentities(@$string)));
?>
Big Bad Dave
flashtektips@hotmail.com