to access a regular global variable in PHP you simply remove the $ from the variable and surround the variable with $GLOBALS['']
, so for example to access a variable declared outside a function $myVar
, you would use $GLOBALS['myVar']
. To do this with an associative array ...
You can also modify the value of a global associate array variable like so:
$GLOBALS['myVar']['state'] = 'Nebraska';