note 24922 added to function.preg-replace-callback
| From: | scott at rack1 dot php dot net | Date: | Thu, 05 Sep 2002 02:47:35 +0000 |
| Subject: | note 24922 added to function.preg-replace-callback | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36144@lists.php.net to get a copy of this message | ||
I really wish PHP would make things like this less awkward... here's the solution (both lines
should print exactly the same thing):
$val = "%2C";
print preg_replace ("/%([a-fA-F0-9]{2})/e", 'pack("c",
hexdec(\'\\1\') )', $val);
print pack("c", hexdec($val));
--
http://www.php.net/manual/en/function.preg-replace-callback.php
http://master.php.net/manage/user-notes.php?action=edit+24922
http://master.php.net/manage/user-notes.php?action=delete+24922
http://master.php.net/manage/user-notes.php?action=reject+24922