I am trying to utilize the following php function:
socket_bind ( resource $socket , string $address [, int $port = 0 ] )
and I have the 3 fields ($socket, $address, $port) available to me but they've been sent to me in a different format. There exists documentation that details how the sender (I am the receiver in this case) will be sending me the address/port:
The address, port, and size should be sent as ASCII representations of the decimal integer formed by converting the values to host byte order and treating them as an unsigned long, unsigned short, and unsigned long respectively.
I need to convert the port back from the unsigned short to an integer so that I can use socket_bind. Is there an easy way to do this in PHP?
Thanks