note 26598 added to function.strip-tags
| From: | nospam at invalid dot com | Date: | Wed, 06 Nov 2002 10:29:04 +0000 |
| Subject: | note 26598 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39029@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
--
http://www.php.net/manual/en/function.strip-tags.php
http://master.php.net/manage/user-notes.php?action=edit+26598
http://master.php.net/manage/user-notes.php?action=delete+26598
http://master.php.net/manage/user-notes.php?action=reject+26598