Posted by Justin Koivisto on 10/10/05 20:40
Womble wrote:
> Hi,
>
> I need to work out the length of a message in network byte order.
>
> Does PHP have an equivalent function of htons and ntohs?
>
> I've searched all the PHP documentation but have so far drawn a blank.
>
I've never used function like that before, but I believe that you may be
able to do it with the pack() function using the correct format. IIRC,
network byte order is big endian, so you;d want to look at n for 16 bit
unsigned short and N for 32-bit unsigned long.
HTH
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
[Back to original message]
|