Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

strip_bbcodes()

Quote

strip_bbcodes(text)

This function will strip declared BBCodes and their content away from quoted messages.

[intro]The strip_bbcodes() function and $__BBCODE_NOT_QUOTABLE__ array were developed when a bug occurred with the [hide] BBCode. When one of admin wants to hide his message from common members, but wants to send something to other admins, he can put his message into [hide] bbcode. All was fine, but when message was quoted, using the quote feature in the forum, everything appeared and could be read from the quoted text.[/intro]

So if any of bbcode puts itself to the $__BBCODE_NOT_QUOTABLE__ array it will be stripped.

Example
If some_bbcode must be hidden it is declare in some_bbcode_include_var.php => $__BBCODE_NOT_QUOTABLE__[] = "some_bbcode"; then will be auto-stripped by strip_bbcodes() function from quoted message in the forum.

Usage

Code
 <?php
 // The [hidden] BBCode has added it self to the
 // $__BBCODE_NOT_QUOTABLE__ array and will be
 // stripped from the text containing BBCodes
 
 $text = "This is a text with some [b]bold[/b] text
 and a [url=www.php-fusion.co.uk]link[/url].
 But we have some [hidden]this text is hidden[/hidden] hidden text.";
 
 echo strip_bbcodes($text);
 ?>

Parameters

The string of text containing bbcodes which will be checked and returned stripped.