htmlspecialchars() or htmlentities without destroying tags?
| From: | Justin French | Date: | Wed, 08 Jan 2003 03:07:27 +0000 |
| Subject: | htmlspecialchars() or htmlentities without destroying tags? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-130685@lists.php.net to get a copy of this message | ||
Hi all,
Has anyone got a function or regexp floating around that will convert behave
like htmlspecialchars() or htmlentities() (eg converting & to &, " to
"e;, etc etc) BUT NOT DESTROY HTML TAGS?
Eg:
"hello" said <a href="fred.php">Fred</a> & Judy
should become:
"hello" said <a href="fred.php">Fred & Judy
NOT:
"hello" said <a href="fred.php">Fred &
Judy
????
I guess it's stripped down or limited version of htmlspecialchars() or
htmlentities().
Justin