Jump to content

PHP binary files


mayami

Recommended Posts

 

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($connection, $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...

Link to comment
https://forums.phpfreaks.com/topic/41933-php-binary-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.