I would follow vincent advice about transmitting var as argument, not as globals; that way for instance :
index.php :
<?
// beginning of index.php
include ('php1.php');
include ('php2.php');
...
$myvar = function_php1 ();
// (BTW, it works even if $myvar is null)
...
$result = function_php2 ($myvar);
// Now do what I want with $result
...
// end of index.php
?>