Folks,

I'm looking for a function that will convert all HTML special characters
(ie, everything converted by htmlspecialchars()) but leave HTML alone.
Consider the following example:

Perhaps their greatest release is "Times & Changes," which sold over
3,000,000 copies, according to <A HREF="http://www.billboard.com/">.

This should be echoed as:

Perhaps their greatest release is &quot;Times &amp; Changes,&quot; which
sold over 3,000,000 copies, according to <A
HREF="http://www.billboard.com/charts/?op=view&name=Before+These+Crowded+Str
eets">.

That is, it leaves alone anything anything within <> tags, but everything
else gets converted.  I assume that this is a relatively simply
preg_replace, but I'm having a bad regex week, so I thought I'd see if
anybody else had written this already. :)  Thanks, all.

Best,
Waldo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to