Código PHP:
<?php
function doBoxCode($text) {
$text = htmlspecialchars($text);
$html = array();
$html[] = array("", "<b>");
$html[] = array("", "</b>");
$html[] = array("[i]", "<i>");
$html[] = array("[/i]", "</i>");
$html[] = array("[u]", "<u>");
$html[] = array("[/u]", "</u>");
$html[] = array("[move]", "<marquee>");
$html[] = array("[/move]", "</marquee>");
$html[] = array("[nl]", "<br>");
foreach ($html as $html) {
$text = str_replace($html[0],$html[1],$text);
}
$text = eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]", "<a href=\"mailto:\\1\">\\1</a>", $text);
$text = eregi_replace("\\[email=([^\\[]*)\\]([^\\[]*)\\[/email\\]", "<a target='_blank' href=\"mailto:\\1\">\\2</a>", $text);
$text = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]", "<a target='_blank' href=\"\\1\">\\1</a>", $text);
$text = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]", "<a target='_blank' href=\"\\1\">\\2</a>", $text);
return $text;
}
?>