PHP binary files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mayami
    New Member
    • Mar 2007
    • 1

    PHP binary files

    Hi,
    I need to send binary data to a server, to which I connect with fsockopen(). I need to send for example 1 byte with value 66 (0x42) and I use fwrite() and pack() functions:

    $message_type = pack("v", 66);
    fwrite($connect ion, $message_type, 1);

    But I don't know which option of pack() I should use ('v' is 16 bits and I need 8 bits...) I tried several options but it didn't work...Could anyone help me? (It is actually urgent... :( ) Thanks in advance...
Working...