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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -