On Friday 25 October 2002 03:52, Shawn McKenzie wrote:
> Some have eluded to this but I haven't seen a working example. I would
> like to declare globals in my main script and then inside functions that
> need these globals just somehow use the $GLOBALS or something to declare
> the variables global in the function.
>
> What I've seen eluded to is loading your $GLOBALS array into an array...
>
> In short, if I add a variable to my globals line in my main script, I don't
> want to have to go and add it to the functions that need it. Make sense???
A global declaration only has effect INSIDE a function. Having it outside of a
function does not make sense (rtfm) and would probably be ignored.
Rather than repeating the examples in the manual here, I suggest you read up
on the section "Variable scope".
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
indent does _not_ solve the problem of:
* buggers who think that MyVariableIsBiggerThanYourVariable is a
good name
- Alexander Viro on coding style
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php