note 71358 deleted from function.chr by danbrown
| From: | danbrown@php.net | Date: | Wed, 15 Sep 2010 21:10:12 +0000 |
| Subject: | note 71358 deleted from function.chr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172592@lists.php.net to get a copy of this message | ||
Note Submitter:
----
I was really surprised to see that work:
$myurl = preg_replace('~%([0-9a-f])([0-9a-f])~ei',
'chr(hexdec("\\1\\2"))', $myurl);
'M%C3%BCnchen' (which is what a Browser makes of an URL containing verbatim utf-8) gives a
nice 2-byte-unicode-char: 'München'