在php中执行系统命令,如LS
<?php // exec.php $cmd = "dir"; // Windows // $cmd = "ls"; // Linux, Unix & Mac exec(escapeshellcmd($cmd), $output, $status); if ($status) echo "Exec command failed"; else { echo "<b>"; foreach($output as $line) echo "$linen"; } ?>
在php中执行系统命令,如LS
<?php // exec.php $cmd = "dir"; // Windows // $cmd = "ls"; // Linux, Unix & Mac exec(escapeshellcmd($cmd), $output, $status); if ($status) echo "Exec command failed"; else { echo "<b>"; foreach($output as $line) echo "$linen"; } ?>