As we know, we can use BitConverter.ToSingle() in C# to convert byte[] containing 4 bytes to a float.
byte[] a = {154,153,89,63};
float floatval = BitConverter.ToSingle(a,0);
and we'll see the value of floatval is 0.85;
Also in VC, we can use readfloat() to read a file flow to do the same thing. So, I wonder if PHP has the same function or how can we accomplish this function using PHP.
PS: I've try to look through McroSoft Reference Source for help, but they use the pointer to sovel the problem, which is not supported in PHP.
Thanks!
And very thanks to Rob to give a possible answer. But in that case.
<?php
var_dump(unpack('f', pack('i', 1059760811)));
?>
It uses 1059760811 the all bytes thing to get the float, but what I have now is 4 bytes, a byte array, as I mentions above
$a = {154,153,89,63}
And I don't know weather there is any connection between byte array and bytes. If there is, please tell me, thanks again!