• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Strip bbcode and contents

Brogan

XenForo moderator
Staff member
#2
I use this in my add-on:
PHP:
$content = XenForo_Helper_String::bbCodeStrip($thread['message']);
$content = preg_replace('/\[(attach|media|img|spoiler)\]/siU', '', $content);
$content = preg_replace('/^[\t\s]*(\r?\n){2,}/m', '', $content);
 

NixFifty

Well-known member
#3
I use this in my add-on:
PHP:
$content = XenForo_Helper_String::bbCodeStrip($thread['message']);
$content = preg_replace('/\[(attach|media|img|spoiler)\]/siU', '', $content);
$content = preg_replace('/^[\t\s]*(\r?\n){2,}/m', '', $content);
Perfect, thanks Brogan. :love: