Passing an Array as Arguments NOT user function, in PHP -


i have 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 pass array $arr pack() function? thing can make:

$res = pack("c*", $unpack_data[1], $unpack_data[2], $unpack_data[3]); 

but length , content of array getting in course of program.

like this:

call_user_func_array('pack', array_merge(['c*'], $unpack_data)) 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -