regex - Remove BBCode tags and their content in PHP -
possible duplicates:
recursive bbcode parsing
strip bbcode via regex
what best way remove bbcode tags of string , content in php?
<?php function stripbbcode($text_to_search) { $pattern = '|[[\/\!]*?[^\[\]]*?]|si'; $replace = ''; return preg_replace($pattern, $replace, $text_to_search); } echo stripbbcode($text_to_search); ?>
Comments
Post a Comment