Explain the difference between shell_exec() and exec()

Technology CommunityCategory: PHPExplain the difference between shell_exec() and exec()
VietMX Staff asked 4 years ago
  • 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 specified as the second parameter.