How to have one PHP script launch another and capture its output?

Posted by George Edison on Stack Overflow See other posts from Stack Overflow or by George Edison
Published on 2010-04-17T04:16:48Z Indexed on 2010/04/17 4:23 UTC
Read the original article Hit count: 201

Filed under:
|
|
|

This is a little tricky so bear with me:

  • I have a PHP script a.php that is launched from the command line and data is provided to it via STDIN
  • I have another PHP script b.php
  • I want to have a.php launch b.php and capture its output.
  • Also, a.php has to forward the STDIN to b.php

Is there an easy way to do this?

© Stack Overflow or respective owner

Related posts about php

Related posts about redirect