note 26598 deleted from function.strip-tags by philip
| From: | philip@php.net | Date: | Tue, 07 Jan 2003 00:22:27 +0000 |
| Subject: | note 26598 deleted from function.strip-tags by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41772@lists.php.net to get a copy of this message | ||
$html_tags = "a|b|i";
$text = preg_replace("'(<)+(/?\b\w+\b>?)'i", "<\\2",
$text);
$text = preg_replace("'(<)+(/?\b($html_tags){1}\b>?)'i",
"<\\2", $text);
This works very nice to rid of undesired html tags.
However if anyone can merge those 2 regex into a single one it would be appreciated :)
-Half