PHP 8.5.0 Alpha 4 available for testing

Voting

: zero minus zero?
(Example: nine)

The Note You're Voting On

dburles@NOSPAMgmailDOTcom
16 years ago
Easy way to capture error output in windows

// we'll execute a php script as an example:
$out = shell_exec("php test.php 2> output");
print $out ? $out : join("", file("output"));

We assume in this case if the script produces output it has ran ok, the $out variable will then contain the output, if $out is empty then we read the captured error output from a file simply called 'output'.

Hope this helps someone

<< Back to user notes page

To Top