note 1020 modified in bin2hex by ronabop
| From: | ronabop@php.net | Date: | Fri, 11 Aug 2000 17:13:50 +0000 |
| Subject: | note 1020 modified in bin2hex by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1315@lists.php.net to get a copy of this message | ||
I wrote a short function to convert the hex string back to binary.
function hex2bin($data) {
$len = strlen($data);
for($i=0;$i<$len;$i+=2) {
$newdata .= pack("C",hexdec(substr($data,$i,2)));
}
return $newdata;
}
http://www.php.net/manual/function.bin2hex.php