Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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');

?>

Documentation

See Also