Hi, I am wondering if it is possible to create a custom superglobal variable so you wouldn't have to use "global $variable" in every function and also wouldn't have to use a PHP global variable. Thanks for any tips
you can always use the $GLOBALS array:
$name = 'dbchip2000'; function test () {echo $GLOBALS['name'];} test (); // outputs dbchip2000
I was looking for a way to not use the $_GLOBALS variable, but to use a custom name. Is this not possible
Why? What would that achieve?
not possible
I would suggest you either global () the var in each function, or use $GLOBALS, or maybe an array withing $GLOBALS, say $GLOBALS['MyConfigArray']