1

I want to use $_REQUEST to get a 64-bit integer, but it does not support 64-bit. (It will be turned to a float.) I need to pack this data and send to service. However it should be big endian byte order, so I can't use format f (float (machine dependent size and representation)) to pack it.

I tried to break it to four 16-bit integers, but I can't use <<,>>or & because it's a float.

How can I solve this problem?

4

1 回答 1

1

Use gmp_div_qr() with 256 or 65536 multiple times to break it up into 8- or 16-bit chunks, then convert those chunks into strings.

于 2012-04-10T03:01:38.653 回答