i'm trying to replace bbcode with html useing preg_replace
what i'v managed to do so far
$patterns[0] = '/color=/';
$patterns[1] = '/color:dce2faf42b/';
$patterns[2] = '/black:dce2faf42b]/';
$patterns[3] = '/red:dce2faf42b]/';
$replacements[0] = 'font color="';
$replacements[1] = 'font';
$replacements[2] = 'black">';
$replacements[3] = 'red">';
ksort($patterns);
ksort($replacements);
$final = preg_replace($patterns, $replacements, $row[3]);
echo nl2br($final);
the problem is i can't figure out how to change "[" to "<"
can anyone help?