// php中这个表示网络字节序
$temp = "\x01\x02";
// n unsigned short (always 16 bit, big endian byte order)
// 使用n,不要使用S或s
$temp = unpack("n",$temp);
// php中这个表示网络字节序
$temp = "\x01\x02";
// n unsigned short (always 16 bit, big endian byte order)
// 使用n,不要使用S或s
$temp = unpack("n",$temp);
转载于:https://www.cnblogs.com/tinyos/p/6925406.html