PHP pack function

Hello All,

I have read PHP manual, and cannot figure this out…

The simple PHP code is as follows:

$a = array( 65,66,67,68,69,70,71,72 );
$str = pack( “C8”,$a);

I get the following error:
Warning: pack(): Type c: too few arguments in /in/SoF8U on line 5

There are 8 values in the array, each value can be converted to a character
I am telling pack to consume 8 characters and pack into a binary string.
What is wrong?

Thanks in advance

Figured it out…

inline explode can be used

$str = pack(“c8”, …$a);

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service