Hi,
I have a file one.php in which there is a variable $twooutput where I need to store the output of running two.php. How can I do this? include does not work as it outputs directly into the output of one.php. exec and passthru do not work either it seems.
Two possible ways:
one.php: <? ob_start(); include 'two.php'; $twooutput = ob_get_contents(); ob_end_clean(); ?>
Or open the file through http:
one.php: <? $fp = fopen('http://example.com/two.php','r'); if ($fp){ $twooutput = fread($fp,50000); } ?>