note 22398 added to function.unpack
| From: | adam at adeptsoftware dot com | Date: | Mon, 17 Jun 2002 01:01:04 +0000 |
| Subject: | note 22398 added to function.unpack | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31929@lists.php.net to get a copy of this message | ||
If you just want to extract a dword/long int from a binary string, the following code works
beautifully (intel endian):
$Number = ord($Buffer{0}) | (ord($Buffer{1})<<8) | (ord($Buffer{2})<<16) |
(ord($Buffer{3})<<24);
--
http://www.php.net/manual/en/function.unpack.php
http://master.php.net/manage/user-notes.php?action=edit+22398
http://master.php.net/manage/user-notes.php?action=delete+22398
http://master.php.net/manage/user-notes.php?action=reject+22398