$GLOBALS This global variable is used to access global variables anywhere in a PHP script (either from a function or a method).
PHP stores all global variables in an array named $GLOBALS[index]. The names of the variables are the keys of the array.
The following example shows how to use the super global variable $GLOBALS:
<?php $x = 75; $y = 25; function addition() { $ GLOBALS ['z'] = $ GLOBALS ['x'] + $ GLOBALS ['y']; } addition(); echo $z; //100 ?>