You can also access global variables anywhere in your scripts with a built-in associative array called $GLOBALS. To access a global variable called $test within a function, you could reference it as $GLOBALS['test'] You can learn more about associative arrays in the next hour.
You can also change global variables from within a function if it has been passed in by reference.
|