* I had to replace examples [ ] with ( ) so they did not get parsed as a quote 😛
The following code takes bbcode like (quote)some quoted text(/quote) and turns it into html. I was hoping someone could help me modify this to include the person it's quoting optionally.
so it would match:
CODEsome quoted text(/quote)[/CODE]
and also match:
CODEsome quoted text(/quote)[/CODE]
function bb2html($text) {
$find = array(
'~\[quote\]~is',
'~\[/quote\]~is'
);
$replace = array(
'<blockquote><div class="quote"><b>Quote:</b><br />',
'</div></blockquote>'
);
return preg_replace($find, $replace, $text);
}