note 65952 deleted from function.htmlentities by danbrown

From: Date: Sun, 17 May 2009 16:56:26 +0000
Subject: note 65952 deleted from function.htmlentities by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154914@lists.php.net to get a copy of this message
Note Submitter: cameron at prolifique dot com ---- I've been asked why I assembled such intricate functions to convert to entities when I could use a very simple solution (like the one offered by soapergem below). The biggest reason is that the PHP htmlentities function and most of the other solutions listed below go haywire on multi-byte strings. In addition, the entire range of numbered entities from &#129; through &#159; are invalid characters, and should not be used (as noted by mail at britlinks dot com below). Most htmlentity functions also do not convert ampersands or pointy brackets (<>) to entities. The ones that do often reconvert existing entities (&amp; becomes &amp;amp;).

« previous php.notes (#154914) next »