Re: Re: global vars inside includes inside functions?
| From: | Red Wingate | Date: | Thu, 29 Apr 2004 16:32:03 +0000 |
| Subject: | Re: Re: global vars inside includes inside functions? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184963@lists.php.net to get a copy of this message | ||
Again ain't no problem anyway
foreach ( $GLOBALS AS $k => $v ) {
$$k =& $GLOBALS[$k] ;} zap you are done ... again when using a function to include a file with relying on depts within the file you would most probably use a registry-pattern or similar to access the required variables. -- red
That makes local copies only, still no access to the global variable The other thing to consider is that everything dies at the conclusion of the function. It may be better to do this via a class construct