note 98793 added to function.strip-tags
| From: | cyex at hotmail dot com | Date: | Thu, 08 Jul 2010 10:40:49 +0000 |
| Subject: | note 98793 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170781@lists.php.net to get a copy of this message | ||
I thought someone else might find this useful... a simple way to strip BBCode:
<?php
$bbcode_str = "Here is some [b]bold text[/b] and some [color=#FF0000]red text[/color]!";
$plain_text = strip_tags(str_replace(array('[',']'),
array('<','>'), $bbcode_str));
//Outputs: Here is some bold text, and some red text!
?>
----
Server IP: 69.147.83.197
Probable Submitter: 118.208.172.66
----
Manual Page -- http://www.php.net/manual/en/function.strip-tags.php
Edit -- https://master.php.net/note/edit/98793
Del: integrated -- https://master.php.net/note/delete/98793/integrated
Del: useless -- https://master.php.net/note/delete/98793/useless
Del: bad code -- https://master.php.net/note/delete/98793/bad+code
Del: spam -- https://master.php.net/note/delete/98793/spam
Del: non-english -- https://master.php.net/note/delete/98793/non-english
Del: in docs -- https://master.php.net/note/delete/98793/in+docs
Del: other reasons-- https://master.php.net/note/delete/98793
Reject -- https://master.php.net/note/reject/98793
Search -- https://master.php.net/manage/user-notes.php