exec() versus using backticks for system calls
If you use exec() to store output in a variable, it only returns the last line of output.
<?php
$output = exec("mycommand");
# or
$output = `mycommand`;
?>
$output = exec("mycommand");
# or
$output = `mycommand`;
?>
The second example returns the entire output of the command and stores it in the $output variable.
[Click to add or edit comments])
Please prepend comments below including a date