Connecting Tech Pros Worldwide Help | Site Map

Adding values to a superglobal array

Rainer Erismann
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi,
i have a variable (well, an Object) which is needed in beneath every Script.
it's not needed to be changed during the whole script, so i like to access
it easyli without passing by or declare it as global in every function.
afaik it isnt possible to set a variable to superglobal.
Is there any reason why i shouldn't add it to the _SERVER array or any other
superglobal?

Thanks


Tom Thackrey
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Adding values to a superglobal array



On 9-Sep-2003, "Rainer Erismann" <erismann@ivp.bepr.ethz.ch> wrote:
[color=blue]
> i have a variable (well, an Object) which is needed in beneath every
> Script.
> it's not needed to be changed during the whole script, so i like to access
> it easyli without passing by or declare it as global in every function.
> afaik it isnt possible to set a variable to superglobal.
> Is there any reason why i shouldn't add it to the _SERVER array or any
> other
> superglobal?[/color]

Why don't you use $GLOBALS? That's what it's for.

--
Tom Thackrey
www.creative-light.com
Closed Thread


Similar PHP bytes