For example, in foo.php:
<?php echo 'hello'; ?>
And in bar.php, I want to get the output of foo.php (which is welcome) and do some formatting before exiting to the browser. Is there any way to do this?
Or even further, if the web server can run PHP and Python scripts, can a PHP script get Python script output?
Edit: The PHP function file_get_contents () can only do this for remote scripts. If used in local scripts, it will return the contents of the entire script. In the above example, it returns instead of a greeting. And I do not want to use the exec () / system () and CGI functions.
source
share