Convert array of values into a single float value in PHP?

Viewed 1483

I have an array with these values (when the array is printed with print_r();

Array:
[0] => 66 
[1] => 233
[2] => 204
[3] => 205

The values in hex are:

Array:
[0] => 0x42 
[1] => 0xE9
[2] => 0xCC
[3] => 0xCD

What I'm looking to do is to turn this 4 byte array into a float value. If I use implode(); to turn the array into a value, it just combines the string into 66233204205 instead of 0x42E9CCCD which are not similar. Thus I can't use floatval(). PHP is new to me, and so is using string values instead of the actual bits, like I can in C.

What I'm thinking is to some how implode() it with the hex values, instead of those integer numbers, and then use floatval().

Any ideas guys?

EDIT:

Just so it's a little clearer, I should be obtaining 116.900 as the result

4 Answers
Related