I\'m maintaining a PHP library that is responsible for fetching and storing incoming data (POST, GET, command line arguments, etc). I\'ve just fixed a bug that would not all
As it was said you can use serialize to pass arrays and other data to command line.
shell_exec('php myScript.php '.escapeshellarg(serialize($myArray)));
And in myScript.php:
$myArray = unserialize($argv[1]);