note 92497 added to function.utf8-decode
| From: | JohanK at osu1 dot php dot net | Date: | Mon, 27 Jul 2009 14:53:06 +0000 |
| Subject: | note 92497 added to function.utf8-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158776@lists.php.net to get a copy of this message | ||
If you simply need to decode a previously numerically escaped string (for example "This is
\xC3encoded\xAF - now what?") into its literal (unencoded) representation:
preg_replace("#(\\\x[0-9A-F]{2})#e", "chr(hexdec('\\1'))", $string);
PS: note the miraculous escaping of \x in the regex as \\\x (!)
----
Server IP: 69.147.83.197
Probable Submitter: 84.35.136.82
----
Manual Page -- http://www.php.net/manual/en/function.utf8-decode.php
Edit -- https://master.php.net/note/edit/92497
Del: integrated -- https://master.php.net/note/delete/92497/integrated
Del: useless -- https://master.php.net/note/delete/92497/useless
Del: bad code -- https://master.php.net/note/delete/92497/bad+code
Del: spam -- https://master.php.net/note/delete/92497/spam
Del: non-english -- https://master.php.net/note/delete/92497/non-english
Del: in docs -- https://master.php.net/note/delete/92497/in+docs
Del: other reasons-- https://master.php.net/note/delete/92497
Reject -- https://master.php.net/note/reject/92497
Search -- https://master.php.net/manage/user-notes.php