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 and PHP shell_exec Function: How to Use It [With Examples].

Related : Back-tick, exec, Shell Exec, Secure Shell (SSH), System