This is a discussion on Adding values to a superglobal array within the PHP Language forums, part of the PHP Programming Forums category; Hi, i have a variable (well, an Object) which is needed in beneath every Script. it's not needed to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
On 9-Sep-2003, "Rainer Erismann" <erismann@ivp.bepr.ethz.ch> wrote: > 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? Why don't you use $GLOBALS? That's what it's for. -- Tom Thackrey www.creative-light.com |