RE: [PHP] Hex operations

From: Date: Thu, 20 Jun 2002 23:37:07 +0000
Subject: RE: [PHP] Hex operations
Groups: php.general 
Request: Send a blank email to php-general+get-103217@lists.php.net to get a copy of this message
looks like it's trying to treat $cap1 as a decimal number, and not a hex number have a look at this: for ($cap = 0; $cap < 64; $cap++) { $cap1 = dechex($cap); $bit = ($cap1 | 0x01); echo "$cap - $cap1 - $bit\n"; } and you'll see what I mean... -----Original Message----- From: Frank S. Kicenko [mailto:frank.kicenko@amjack.ca] Sent: Friday, June 21, 2002 9:28 AM To: php-general@lists.php.net Subject: [PHP] Hex operations Ugggg... Does anybody know why this doesn't work... Example: $cap = 16383; $cap1 = dechex($cap); // cap1 is now equal to 3FFF; $bit = ($cap1 | 0x01); //bit should equal 3FFF, but it doesn't.. it is always = 3 !! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#103217) next »