note 26627 deleted from function.strip-tags by vrana
| From: | vrana@php.net | Date: | Mon, 22 Dec 2003 16:19:57 +0000 |
| Subject: | note 26627 deleted from function.strip-tags by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62332@lists.php.net to get a copy of this message | ||
Note Submitter: Half-Dead@nospam.com
----
$html_tags = "a|b|i";
$text = preg_replace("'(<)+(/?.+>?)'i", "<\\2", $text);
$text = preg_replace("'(<)+(/?\b($html_tags){1}\b>?)'i",
"<\\2", $text);
This works nice to escape undesireable html tags.
However if anyone can merge those 2 regex into a single one it would be appreciated :)