Re: Binary data -> number

From: Date: Wed, 16 Apr 2003 18:27:13 +0000
Subject: Re: Binary data -> number
Groups: php.general 
Request: Send a blank email to php-general+get-144180@lists.php.net to get a copy of this message
On Wednesday, April 16 2003 at 5:22 AM, Jason Wong wrote:
On Wednesday 16 April 2003 09:37, Adam Atlas wrote:
I have some code that reads binary data (a series of bytes representing numbers, not ASCII characters) and I want to know how I'd extract the numerical value of multiple bytes. For example, if I had two bytes with the hex value 0xFFFF, I'd like to know how to get its decimal value, 65535 (I think). (But remember, this is just binary data, not a string representation of hex or binary.)
Doesn't bin2hex() do what you want?
I forgot to mention, the binary data must be treated as big-endian. Will this still work? Thanks, Adam Atlas ~~~ Adam Atlas Your mouse has moved. Windows has to reboot for changes to take effect. [ OK ]

« previous php.general (#144180) next »