note 107792 added to function.htmlentities
| From: | geompse at gmail dot com | Date: | Mon, 05 Mar 2012 11:00:12 +0000 |
| Subject: | note 107792 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186498@lists.php.net to get a copy of this message | ||
Be careful, before PHP5.4 $encoding is NOT set by default to 'ISO-8859-1' ; it is set to
'ISO-8859-15'.
Lost a few hours moving from PHP5.3 to PHP5.4...
<?php
echo 'Character : Œ<br />';
echo 'HTML entity : &OElig;<br />';
echo 'html_entity_decode/ISO-8859-1 :
'.html_entity_decode('Œ',ENT_COMPAT|ENT_HTML401,'ISO-8859-1').'<br
/>';
echo 'html_entity_decode/ISO-8859-15 :
'.html_entity_decode('Œ',ENT_COMPAT|ENT_HTML401,'ISO-8859-15').'<br
/>';
?>
Will output :
Character : Å
HTML entity : Œ
html_entity_decode/ISO-8859-1 : R
html_entity_decode/ISO-8859-15 : Å
(Last line may appear with a � depending on your browser encoding)
----
Server IP: 89.31.146.176
Probable Submitter: 82.227.124.74
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit -- https://master.php.net/note/edit/107792
Del: integrated -- https://master.php.net/note/delete/107792/integrated
Del: useless -- https://master.php.net/note/delete/107792/useless
Del: bad code -- https://master.php.net/note/delete/107792/bad+code
Del: spam -- https://master.php.net/note/delete/107792/spam
Del: non-english -- https://master.php.net/note/delete/107792/non-english
Del: in docs -- https://master.php.net/note/delete/107792/in+docs
Del: other reasons-- https://master.php.net/note/delete/107792
Reject -- https://master.php.net/note/reject/107792
Search -- https://master.php.net/manage/user-notes.php