I have the following code:
$bin = "\x04\x00\xa0\x00\x04\x00\xa0\x00";
$unpack_data = unpack("C*", $bin);
$arr = array($unpack_data[1], $unpack_data[2], $unpack_data[3]);
How can I pass an array $arr to a pack() function? The only thing that I can make:
$res = pack("C*", $unpack_data[1], $unpack_data[2], $unpack_data[3]);
but the length and content of the array are getting in the course of the program.