note 13868 modified in function.ord.php by jeroen

From: Date: Sun, 08 Jul 2001 20:51:48 +0000
Subject: note 13868 modified in function.ord.php by jeroen
Groups: php.notes 
Request: Send a blank email to php-notes+get-15101@lists.php.net to get a copy of this message
[Ed: bindec() does this for you... it only doesn't get the sign-bit. Your solution will result in a float with the sign is set! http://www.php.net/bindec --jeroen ] Erm this one took me a while to work out, in the end a friend told me, if ur working out the value of an 32bit integer ($data) then this is 4 u ;-) $num=ord($data[0])+(ord($data[1])<<8)+(ord($data[2])<<16)+(ord($data[3])<<24); if ($num>=4294967294){ $num-=4294967296; } http://www.php.net/manual/function.ord.php.php

« previous php.notes (#15101) next »