有没有办法让这个简单的脚本正常运行?
<?php
$hi = "echo hi";
shell_exec($hi);
echo "<pre>$output</pre>";
?>
请帮帮我吗?
答案 0 :(得分:3)
当然只需分配变量。
<?php
$hi = "echo hi";
$output = shell_exec($hi);
echo "<pre>$output</pre>";
?>
答案 1 :(得分:1)
$hi = "echo hi";
# the result needs to be assigned to $output before using it
$output = shell_exec($hi);
echo "<pre>$output</pre>";