After consulting the php manual, I can tell you that php just doesn't provide a way to read binaries, but I think there is a pretty good way to do this (inspired by c and fread )
class BinaryReader { const FLOAT_SIZE = 4; protected $fp = null;
If you have any improvements or tips, just post them in the comments, I will be happy to extend the answer.
source share