The example in this article describes the method of executing system commands in php. Share it with everyone for your reference. The specific analysis is as follows:
Execute system commands in php, such as 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"; } ?>
I hope this article will be helpful to everyone’s PHP programming design.