The little known PHP htmlspecialchars

Posted by Chief on Feb 20, 2010 in Reference | Subscribe

Want to replace only xml entities <, >, &? Don’t use htmlentites or str_replace; use htmlspecialchars.

The only named entities for XML are &amp;, &gt; and &lt;. For all others you need to use the Unicode character code (eg. &#160;). Webkit: Entity ‘nbsp’ not defined – Convert HTML entities to XML

Tags: , , , ,

Copyright © 2010 cat brain.log | less All rights reserved.
Shades v1.2 theme from BuyNowShop.com.