May 17, 2007
shell_exec() example
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
Add ‘2>&1′ to the end of your shell command to have STDERR returned as well as STDOUT.
$shell_return = shell_exec($shell_command." 2>&1");
&1' to the end of your shell command to have STDERR returned as well as STDOUT. $shell_return = shell_exec($shell_command." ..."/>
May 17, 2007
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
Add ‘2>&1′ to the end of your shell command to have STDERR returned as well as STDOUT.
$shell_return = shell_exec($shell_command." 2>&1");
Leave a Reply
You must be logged in to post a comment.