Re: Fw: [PHP-DEV] PHP 4.0 Bug #7829: hex2bin()?
| From: | Adam Trachtenberg | Date: | Wed, 15 Nov 2000 17:16:49 +0000 |
| Subject: | Re: Fw: [PHP-DEV] PHP 4.0 Bug #7829: hex2bin()? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-38154@lists.php.net to get a copy of this message | ||
Is base_convert() not working for you?
http://www.php.net/manual/function.base-convert.php
-adam
On Wed, 15 Nov 2000, Jon Tai wrote:
> function hex2bin($hex_str) {
> for ($i = 0; $i < strlen($hex_str); $i += 2) {
> $bin_str .= chr(hexdec(substr($hex_str, $i, 2)));
> }
> return $bin_str;
> }
>
> I've been using this homemade one in the past, but I agree that a hex2bin
> function should be built in.
--
/ adam maccabee trachtenberg | visit college life online \
\ adam@student.net | http://www.student.com /