Does anyone know a way I can register my own superglobal?
Meaning, I would like to make my own variable such as $_SESSION which
is available in all scopes and contexts without having to declare it
with a global.
Example:
global $testVar;
$testVar = 1;
test();
function test(){
echo $testVar;
}
This would print "", I want to be able to
register_superg lobal('testVar' ) and have the function print out "1"...
Any ideas?
Thanks!
Meaning, I would like to make my own variable such as $_SESSION which
is available in all scopes and contexts without having to declare it
with a global.
Example:
global $testVar;
$testVar = 1;
test();
function test(){
echo $testVar;
}
This would print "", I want to be able to
register_superg lobal('testVar' ) and have the function print out "1"...
Any ideas?
Thanks!
Comment