PHP shell_exec() 与 exec() [英] PHP shell_exec() vs exec()

查看:50
本文介绍了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.

这篇关于PHP shell_exec() 与 exec()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆