寻找 PHP 中 exec 的简单解释

发布于 2024-08-31 22:24:31 字数 43 浏览 3 评论 0原文

我无法理解 PHP 中的 exec 函数。有人可以简单地向我解释一下吗?

I am having trouble understanding the exec function in PHP. Can someone please explain it to me in simple terms?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

Saygoodbye 2024-09-07 22:24:31

exec — 在系统命令解释器中执行命令 cmd 并返回最后一行输出。可选参数允许捕获命令输出和返回值。

string exec(cmd[, array_name][, $return_value]);
string cmd:要执行的命令

exec — Executes command cmd in the system's command interpreter and returns the last line of output. Optional arguments allow the command output and return value to be captured.

string exec(cmd[, array_name][, $return_value]);
string cmd: Command to be executed

少女净妖师 2024-09-07 22:24:31

exec 将调用电脑上运行脚本的程序,并返回最后一行输出。例如

$result = exec('echo bla');
echo $result; // outputs 'bla'

(通常您不想使用它,并且出于安全考虑,某些共享托管服务器不允许使用它)

exec will call a program on the pc which runs your script and will return the last line of the output. e.g.

$result = exec('echo bla');
echo $result; // outputs 'bla'

(usually you don't want to use it, and some shared hosting servers do not allow it's usage due to security concerns)

淡看悲欢离合 2024-09-07 22:24:31

我更喜欢 shell_exec http://php.net/manual/en/function.shell -exec.php 它返回所有输出

i prefer shell_exec http://php.net/manual/en/function.shell-exec.php it returns all output

谁把谁当真 2024-09-07 22:24:31

http://php.net/exec

(如果没有更具体的问题,提供任何其他答案似乎没有什么意义)

http://php.net/exec

(There seems little point in providing any other answer without a more specific question)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文