<?php
function stripBBCode($text_to_search) {
$pattern = '|[[\/\!]*?[^\[\]]*?]|si';
$replace = '';
return preg_replace($pattern, $replace, $text_to_search);
}
$text_to_search = "[url=http://google.com]google[/url] is fine";
echo stripBBCode($text_to_search);
?>