$GLOBALS takes all variables defined in global scope within a script and makes them accessible within any scope.
$GLOBALS is a superglobal array,
meaning that if you define a variable in the regular scope of a script:
$foo = "hello mom!";
And want to access that variable within a function,
instead of doing the global keyword:
global $foo;
or passing it to a function
$some_return_data = foo_function($foo);
You can access it directly within the function with the $GLOBALS array, thereby by-passing the other methods
function foo_function($some_parameters) {
//this will reference the $foo variable originally set
echo $GLOBALS["foo"];
//this will output nothing
echo $foo;
//this will output the $foo variable as passes as a parameter
echo $some_parameters;
}
But by Global, this variable does not imply persistence of data between HTTP requests, for that you will need $_SESSION.
hth,
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::