Search found 2 matches

by drugcoder
Fri Mar 04, 2005 1:24 pm
Forum: PHP - Code
Topic: binary value in one string byte
Replies: 3
Views: 273

So would you suggest something like

$PckLen = pack('a4',78);

to show a packet length of 78 bytes, using a null padded 4 byte string?
by drugcoder
Fri Mar 04, 2005 1:11 pm
Forum: PHP - Code
Topic: binary value in one string byte
Replies: 3
Views: 273

binary value in one string byte

I am working on some socket communications using PHP, and am having a small problem. The server is requiring the packet size be listed in binary using the first four bytes. I don't know what I'm doing wrong but I can't seem to store a binary number in these four bytes. Does anyone have any suggestio...