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

javascript - Iterate over array and calculate average values of array-parts -

php - Time zone issue -

iphone - Using nested NSDictionary with Picker -