converting html entities outside of tags
| From: | Alain Dresse | Date: | Fri, 15 Mar 2002 20:17:02 +0000 |
| Subject: | converting html entities outside of tags | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88702@lists.php.net to get a copy of this message | ||
Hi,
I want to allow the users of my site to insert text with anchors, bold and
italic html tags. I have filtered out all the other tags. I now want to
convert the other <, >, quote, double quote and & to html entities. If I use
the function htmlspecialchars, it of course also quotes the "valid" anchors.
For instance, I would like the following
This is a <a href="http://www.domain.com">string with "quotes"
and other
< signs </a>
to be converted to
This is a <a href="http://www.domain.com">string with
"quotes"
and other < signs </a>
and not
This is a <a href="http://www.domain.com">string
with
"quotes" and other < signs </a>
Can anybody help ?
Thanks,
Alain Dresse
adresse@brutele.be