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); ?> 

demo


Comments

Popular posts from this blog

objective c - Newbie question -multiple parameters -

iphone - Using nested NSDictionary with Picker -

php - accessing mysql using different server to which db connection data is located -