PHP shell_exec()与exec() [英] PHP shell_exec() vs exec()
本文介绍了PHP shell_exec()与exec()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在努力了解shell_exec()
和exec()
...之间的区别...
I'm struggling to understand the difference between shell_exec()
and exec()
...
我一直使用exec()
执行服务器端命令,何时使用shell_exec()
?
I've always used exec()
to execute server side commands, when would I use shell_exec()
?
shell_exec()
只是exec()
的简写吗?更少的参数似乎是同一回事.
Is shell_exec()
just a shorthand for exec()
? It seems to be the same thing with fewer parameters.
推荐答案
shell_exec
返回所有输出流作为字符串. exec
默认情况下返回输出的最后一行,但可以将所有输出作为指定为第二个参数的数组提供.
shell_exec
returns all of the output stream as a string. exec
returns the last line of the output by default, but can provide all output as an array specifed as the second parameter.
请参见
- http://php.net/manual/en/function.shell-exec.php
- http://php.net/manual/en/function.exec.php
这篇关于PHP shell_exec()与exec()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文