how to define a global variable inside a php function code example
Example 1: how make a variable global php
$a = 1;
$b = 2;
function Sum(){
global $a, $b; // allows access to vars outside of function
$b = $a + $b;
}
Sum();
echo $b; // output is 3
Example 2: php globals
$GLOBALS["foo"]