Re: [PHP] Binary to ASCII

2004-05-10 Thread Curt Zirzow
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]): > * Thus wrote Ren Fournier ([EMAIL PROTECTED]): > > //I would Assume that that was packed with something like this: > $string = 'The system is up and running.'; > $pck = pack('a3iia*a3', 'STX', strlen($string), 38, $string, 'ENX'); > echo $pck, "\n";

Re: [PHP] Binary to ASCII

2004-05-10 Thread Curt Zirzow
* Thus wrote Ren Fournier ([EMAIL PROTECTED]): > When reading from a Socket Server, my Socket Client retrieves data that > includes ASCII and binary data: > > while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) { > $data .= $buf; > if(preg_match("/ENX/", $data)) break;

[PHP] Binary to ASCII

2004-05-10 Thread René Fournier
When reading from a Socket Server, my Socket Client retrieves data that includes ASCII and binary data: while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) { $data .= $buf; if(preg_match("/ENX/", $data)) break; } echo "RESPONSE: ".$data."\n"; The output look