PHP执行linux命令获取执行结果
2019-06-03 本文已影响0人
两分与桥
#!/usr/bin/php
<?php
exec("ls“, $output);
echo json_encode($output);
echo "\r\n";
$a = shell_exec("ls");
echo json_encode($a);
echo "\r\n";
#!/usr/bin/php
<?php
exec("ls“, $output);
echo json_encode($output);
echo "\r\n";
$a = shell_exec("ls");
echo json_encode($a);
echo "\r\n";