I am writing a binary socket client in PHP and that is a pain. I am currently using packto convert numbers to binary strings, but this is not enough. Two options are possible pack:
- Write signed 32-bit integer in machine byte order
- Write 32-bit integer in bytes of large byte
But I need to write signed 32-bit integers in large trailing order, as in Java DataOutputStream.writeInteger. packdoes not have this option.
Is there a way to do this with pack, or convert the output pack, or perhaps the best binary data library in PHP?
source
share