View Single Post
Old Dec 31st, 2005, 5:24 PM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Maybe you should take advantage of preg_replace_callback:
[PHP]function remove_br_tags($matches) {
return preg_replace("/<br>/", "", $matches[0]);
}

$str = "blah1<br>blah2 blah3 <pre>asdf<br>123<br></pre> blah4 blah5<br>blah6";

$str = preg_replace_callback("/<pre>.*?<\/pre>/", "remove_br_tags", $str);[/PHP]
Arevos is offline   Reply With Quote