//have to break up this first line to prevent the board getting clever and distorting my code.
$txt = "[" . color=anycolor" . "]any text[" . "/color]";
$txt = str_replace($txt, "[color", "<font color");
echo $txt . "<br>";
$txt = str_replace($txt, "[/color]", "</font>");
echo $txt . "<br>";
$txt = str_replace($txt, "]", ">");
echo $txt . "<br>";
the final change is to clean up the last ], the echo's are to help you see what happens at each step.