shell_exec()
shell_exec() executes a command with the underlying operating system. They are the equivalent of the backtick operator \`.
The command has to be passed as a string. The result is returned also as a string, or a null when the command fails.
<?php
$dir = shell_exec('ls');
?>
See Also
- Explain the Difference Between shell_exec() and exec() Functions
- PHP shell_exec Function: How to Use It [With Examples]