<?php //send result of php script back $num = 3; eval("include 'http://www.example.com/myScript.php?num=$num';"); ?>
I should note that by default the result of eval() is sent directly to the browser. If you want to capture the result, do something like the following:
<?php //capture results of eval() $num = 3; ob_start(); eval("include 'http://www.example.com/myScript.php?num=$num';"); $result = ob_get_contents(); ob_end_clean(); ?>
The eval()function can be used in many situations, of course. For one, you might have PHP code stored in a database that is rendered and included dynamically in a script.
Also, be sure that the string you pass contains all valid syntax including semicolons.