Does anyone know how to write binary data in a PHP socket?
I have tried using standard file functions but it doesn't work. This is my code:
<?php
$fp = fsockopen("127.0.0.1", 15000, &$errno, &$errstr, 30);
if(!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
$num = 65;
fwrite($fp,$num,4);
fclose($fp);
}
?