Is there a way to make all variables global?
You Can simple make them a reference to $GLOBALS
foreach($GLOBALS as $k => $v)
$$k=&$GLOBALS[$k];
Explanation of the code:
$GLOBLAS is a superglobal variable (visible everywhere). Basicly it contains all variables
$$ means the variable with the name of the value of the variable you wrote
Bit weird to explain in a foreign language so here's an example:
$color='blue';
$blue='foo';
echo $$color;
will output
foo
$k=& $v;
means that $k is a reference to $v