$replace4 = "</a>";
$str = str_replace($search4, $replace4, $str);
$search5 = "[/font]";
$replace5 = "</span>";
$str = str_replace($search5, $replace5, $str);
$search6 = "]";
$replace6 = "">";
$str = str_replace($search6, $replace6, $str);
$search7 = "[font size=";
$replace7 = "<span style="font-size:";
$str = str_replace($search7, $replace7, $str);
$search8 = "[url=";
$replace8 = "<a rel="external" href="";
$str = str_replace($search8, $replace8, $str);
return $str;
}
$text = <<< END
this is some text that has been
processed by php to replace the bbcode. this is a
link
http://www.xanga.com
http://forums.devnetwork.net
and that is [font size=20]big[/font]. look this is
my e-mail naymyo89@hotmail.com
END;
$text = format($text);
echo $text;
?>[/syntax]
Okay, it looks fine but when it's al done I get:
Code: Select all
<strong>this</strong> is some text that has been<br />
<em>processed</em> by php to replace the <u>bbcode</u>. this is a<br />
<a rel="external" href="<a href="http://yahoo.com rel="external">http://yahoo.com</a>">link</a> <br />
<a href="http://www.xanga.com" rel="external">www.xanga.com</a><br />
<a rel="external" href="<a href="http://forums.devnetwork.net rel="external">http://forums.devnetwork.net</a></a><br />
and that is <span style="font-size:20">big</span>. look this is<br />
my e-mail <a href="mailto:naymyo89@hotmail.com">naymyo89@hotmail.com</a>Code: Select all
<a rel="external" href="<a href="http://yahoo.com rel="external">http://yahoo.com</a>">link</a>-Nay