Executes a command.
This function executes a command in a shell. The optional output parameter is used to return the output of the command to the script. Many commands and programs use their return value to indicate whether they succeeded or failed. This value can be returned through the option return_value. exec() returns the last line of output.
<?php
exec("ls upload", $output);
foreach ($output as $line) {
print "$line<br>";
}
?> code.php
log.txt exec() is used to list the contents of a directory.