I wish to call a local PHP page with PHP with the server side code already executed.
For instance, if I have a page with the following content:
Hello, this is <?php $name="John"; echo $name ?>
I wish to have a get command such as file_get_contents(local_php_page) or fopen(handle) return:
Hello, this is John
Rather than
Hello, this is <?php $name="John"; echo $name ?>
What’s the best way to do this?
Output Buffering should be able to do that for you:
You could also get the output of your include, eg:
For more on this, check out The PHP Manual