Re: Re: make global variables accessible to functions?
| From: | Bing Du | Date: | Fri, 07 Apr 2006 17:35:02 +0000 |
| Subject: | Re: Re: make global variables accessible to functions? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233454@lists.php.net to get a copy of this message | ||
Thanks for the response.
> That way is secure and has nothing to do with register_globals ;)
>
Good. That's what I wanted to hear. I know by default some pre-defined
global variables can be accessed through $GLOBALS. If I don't want end
users to add their own user defined variables in the superglobal area, how
should I do that?
> What you can do too is this:
>
> <?php
> function foo($a) {
> echo "a is $a";
> }
> ?>
Yeah, I know it works this way. The reason I don't go this way is I have
quite a few variables that need to be passed to the function, it's not
feasible to pass all them as funtion parameters.
Bing