Nie wiem czy dobrze Cie zrozumiałem ale parser BBCode wygląda mniej więcej tak
<?php
function bb2html($text)
{
$bbcode = array("<", ">", "[img]", "[/img]",
"", "",
"", "",
"", "",
'[color="', "[/color]",
"[size=\"", "[/size]",
$htmlcode = array("<", ">", "<ul>", "<li>", "</ul>",
"<img src=\"", "\">",
"<b>", "</b>",
"<u>", "</u>",
"<i>", "</i>",
"<span style=\"color:", "</span>",
"<span style=\"font-size:", "</span>",
'<a href="', "</a>",
"<a href=\"mailto:", "</a>",
"<code>", "</code>",
"<table width=100% bgcolor=lightgray><tr><td bgcolor=white>", "</td></tr></table>",
'">');
$newtext = nl2br($newtext);//second pass return $newtext;
}
?>
Przykład z: [url="http://elouai.com/bbcode-sample.php"]http://elouai.com/bbcode-sample.php