converting html entities outside of tags

From: 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 &quot;quotes&quot; and other &lt; signs </a> and not This is a &lt;a href=&quot;http://www.domain.com&quot;&gt;string with &quot;quotes&quot; and other &lt; signs &lt;/a&gt; Can anybody help ? Thanks, Alain Dresse adresse@brutele.be

« previous php.general (#88702) next »