* 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";
IIRC, your Original post mention the requirement of big endian byte
order. If that is the case you want
pack('a2NNa*a3', ...)
>
> //So This will unpack it for you.
> $unpacked = unpack('a3code/istrlen/itype/a*stringWithEndDelim', $pck);
ditto with unpack:
unpack('a3code/Nstrlen/Ntype/a*stringWithEndDelim', ...)
See the chart here for what type gets converted from what:
http://php.net/pack
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php