mayami Posted March 9, 2007 Share Posted March 9, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.