473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Adding values to a superglobal array

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
Jul 16 '05 #1
1 3175

On 9-Sep-2003, "Rainer Erismann" <er******@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
Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Super Mango | last post by:
Hi - Is it possible to change the status of a variable to superglobal so it'll be valid inside functions without declaring it with "global" inside each function? Thanks -
3
by: petermichaux | last post by:
Hi, I thought that $_POST was read only. I just descovered I can change the values of it's elements. Is this considered bad style? Seems like this might be something that is outlawed in the...
3
by: mtjarrett | last post by:
i having trouble accessing the values from superglobal arrays. there are two situations but i'm pretty sure it's the same problem. here's the deal: on page1.php i have several check boxes. ...
5
by: splodge | last post by:
This may seem like a stupid question but I want to check before I go ahead and build this... I am working on a portal, part of which allows users to upload files. Part of the array within...
17
by: Sri | last post by:
How do you add an n-bit number in C? Regards, Sri
1
by: mtchatchez | last post by:
I have several 2-dimensional arrays which I want to sum the values of, returning an array that has for each of its values the sum from all the others (if that makes sense?) ... Okay ... maybe an...
3
by: P Pulkkinen | last post by:
This is just for curiosity, but: Lets say I would like to have a new superglobal, in addition to automatically made get, post, cookie and session. I mean, I would (theoretically) want to AVOID...
3
by: prabodhtiwari | last post by:
function submitPartsForm(str) { var count=document.getElementsByName("partId"); for(var i=0;i<count.length;i++) { document.mylist.myNum.value= document.getElementsByName("partNum")...
11
by: dennis.sprengers | last post by:
Consider the following multi-dimensional array: --------------------------- $arr = array( array(3, 5, 7, 9), array(2, 4, 6, 8), array(1, 3, 5, 7) ); function add_arrays($arr) { for ($row =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.