Skip to content

Instantly share code, notes, and snippets.

@riza
Created July 29, 2014 10:38
Show Gist options
  • Save riza/a2eeed81d36cded23b0d to your computer and use it in GitHub Desktop.
Save riza/a2eeed81d36cded23b0d to your computer and use it in GitHub Desktop.
shell-exec
<?php
function shExec($commands) {
$cnt = count($commands);
for ($i=0; $i < $cnt ; $i++) {
$cmd = shell_exec($commands[$i]);
echo $cmd."<br>";
}
}
$asd = array('uname -a','ls -l','cat /etc/passwd');
shExec($asd);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment