how get the output from process opend by popen in php?

后端 未结 3 803
灰色年华
灰色年华 2020-12-10 14:15

file a.php:


file b.php:


3条回答
  •  青春惊慌失措
    2020-12-10 14:55

    Check the second example in the documentation on popen, it shows exactly how to do that:

    &1', 'r');
    echo "'$handle'; " . gettype($handle) . "\n";
    $read = fread($handle, 2096);
    echo $read;
    pclose($handle);
    

    This snippet reads from stderr. Remove the pipe to read from stdout.

提交回复
热议问题