Fw: [PHP-DEV] PHP 4.0 Bug #7829: hex2bin()?
| From: | Jon Tai | Date: | Wed, 15 Nov 2000 17:30:12 +0000 |
| Subject: | Fw: [PHP-DEV] PHP 4.0 Bug #7829: hex2bin()? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-38155@lists.php.net to get a copy of this message | ||
Sounds good to me. Perhaps a link to base_convert() with the "hex2bin"
example should be put in the manual page for bin2hex() then?
----- Original Message -----
From: "Adam Trachtenberg" <adam@student.net>
To: "Jon Tai" <jon@tgpsolutions.com>
Cc: <php-dev@lists.php.net>
Sent: Wednesday, November 15, 2000 9:16 AM
Subject: Re: Fw: [PHP-DEV] PHP 4.0 Bug #7829: hex2bin()?
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 /
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net