shell_exec
returns all of the output stream as a string. exec
returns the last line of the output by default, but can provide all output as an array specifed as the second parameter.
See
- http://php.net/manual/en/function.shell-exec.php
- http://php.net/manual/en/function.exec.php