[PHP exec_shell通过输入字符串

问题描述 投票:0回答:1

我可以这样使用shell_exec:

$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";

但是这不起作用:

$job = 'ls -lart';
$output = shell_exec($job);
echo "<pre>$output</pre>";

是否可以给shell_exec一个字符串?

php shell-exec
1个回答
0
投票

工作。错误不是shell_exec,而是错误赋予了两个字符串...

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.