note 120005 added to function.html-entity-decode

From: Date: Fri, 07 Oct 2016 15:54:23 +0000
Subject: note 120005 added to function.html-entity-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-206802@lists.php.net to get a copy of this message
When using this function, it's a good idea to pay attention when it says that leaving the charset parameter empty is "not recommended". I had an issue where I was storing text files, with entities converted, into a database. When I retrieved them later and ran $text_file = html_entity_decode($text_data); the entities were NOT decoded. Once I was aware of the problem, I changed the decode call to fully specify all of the parameters: $text_file = html_entity_decode($text_data, ENT_COMPAT | ENT_HTML5,'utf-8'); This converted the entities as expected. ---- Server IP: 72.52.91.14 Probable Submitter: 50.47.74.26 ---- Manual Page -- http://php.net/manual/en/function.html-entity-decode.php Edit -- https://master.php.net/note/edit/120005 Del: integrated -- https://master.php.net/note/delete/120005/integrated Del: useless -- https://master.php.net/note/delete/120005/useless Del: bad code -- https://master.php.net/note/delete/120005/bad+code Del: spam -- https://master.php.net/note/delete/120005/spam Del: non-english -- https://master.php.net/note/delete/120005/non-english Del: in docs -- https://master.php.net/note/delete/120005/in+docs Del: other reasons-- https://master.php.net/note/delete/120005 Reject -- https://master.php.net/note/reject/120005 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206802) next »