List Info

Thread: note 79020 added to function.unpack




note 79020 added to function.unpack
user name
2007-11-07 06:28:10
Correct substr  

If you are trying to make unpack 'N' work with unsigned long
on 64 bit machines, you should take a look to this bug:
http://bugs.php.
net/bug.php?id=40543

An ugly workaround for me was:

//Read a 4-byte integer from file
      $_r = fread($f,4);
      $a=unpack('Ni',$_r);
      $b = sprintf("%b", $a['i']); // binary
representation
      if(strlen($b) == 64){
           $new = substr($b, 32);
           $a['i'] = bindec($new);
       }
----
Server IP: 195.54.192.44
Probable Submitter: 91.149.66.60
----
Manual Page -- http
://www.php.net/manual/en/function.unpack.php
Edit        -- https://master
.php.net/note/edit/79020
Del: integrated  -- h
ttps://master.php.net/note/delete/79020/integrated
Del: useless     -- http
s://master.php.net/note/delete/79020/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/79020/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/79020/spam
Del: non-english -- 
https://master.php.net/note/delete/79020/non-english
Del: in docs     -- http
s://master.php.net/note/delete/79020/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/79020
Reject      -- https://mast
er.php.net/note/reject/79020
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )