note 19762 deleted from function.strip-tags by vrana
| From: | vrana@php.net | Date: | Mon, 22 Dec 2003 15:44:26 +0000 |
| Subject: | note 19762 deleted from function.strip-tags by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62322@lists.php.net to get a copy of this message | ||
Note Submitter: aktivisti@hotmail.com
----
There's a simple way to strip tags,
just replace all < > -marks with > and <.
$text = "somecomment <b>htmltest</b>";
$text = str_replace("<", "%gt;", $text);
$text = str_replace(">", "%lt;", $text);
$text is now "somecomment >b<htmltest>/b<" so in page it looks
like "somecomment <b>htmltest</b>".