您可以将输出从stdout重定向到数组。
在此页面上,您可以执行以下操作:
string exec ( string $command [, array &$output [, int &$return_var ]] )
它继续说:
如果存在output参数,则命令的输出的每一行都将填充指定的数组。
所以基本上您可以执行exec(’casperjs command here,$ array_here);

您可以将输出从stdout重定向到数组。
在此页面上,您可以执行以下操作:
string exec ( string $command [, array &$output [, int &$return_var ]] )
它继续说:
如果存在output参数,则命令的输出的每一行都将填充指定的数组。
所以基本上您可以执行exec(’casperjs command here,$ array_here);