$thearr = array(
"\[br](.*?)\[/br]" => "<br>\\1</br>",
"\(.*?)\" => "<u>\\1</u>" );
foreach (array_keys($thearr) as $i) {
$input = preg_replace( "#$i#si", $thearr[$i], $input );
}
// i havent tested it, but it whould cut your replaces by 1/2, but you will need to use the preg_replace function which is slower, maybe try timing them to see which is faster?