Importing C variables into PHP

I am sending variables in HEX to my server which is running PHP in order to cut down on data transfer. I was thinking about using the unpack function from PHP. Is this the right direction to convert integers, floats, and uint8_t?

I am sending variables in HEX to my server

Using what code?

I was thinking about using the unpack function from PHP. Is this the right direction to convert integers, floats, and uint8_t?

From http://us.php.net/manual/en/function.unpack.php:

Unpacks from a binary string into an array according to the given format.

Looking at the example, I'd say no, unpack is not even close to the right function.

I was using just writing the variables directly to the contents of an http post. The hex arrives in to php as a variable. The unpack function with a bit of tweaking looks like it can handle the basic stuff. I feel like this has to have been done before, I just dont want to reinvent the wheel if someone else has some slick functions.

I feel like this has to have been done before, I just dont want to reinvent the wheel if someone else has some slick functions.

A PHP forum perhaps?