plumdavid 发表于 2013-06-22 20:27

exec函数调用linux shell脚本,为什么返回参数$output是数组变量

string exec ( string $command [, array &$output [, int &$return_var ]] )是PHP调用linux shell脚本函数。

其中,$output是linux shell脚本$command的返回值,我认为linux shell只能返回字符串,为什么$output是数组变量呢?

plumdavid 发表于 2013-06-22 20:53


明白了。

exec把shell返回值按行划分成数组,每一行是一个数组元素。
页: [1]
查看完整版本: exec函数调用linux shell脚本,为什么返回参数$output是数组变量