Make global variables available to an included file within a function

Kink

New Member
i need to include files within a function, and files use lots of variables defined earlier in the script.using global is not an option because it is impossible to say which variables will be used in included files.the only one real solution is to make all global variables accessible in function, something like:\[code\] function finc($file) { foreach($GLOBALS as $k=>$v) { $$k=$v; } include $file; }\[/code\]but it won't be good when using lots of files with lots of variables, so is there any better way to do it?
 
Back
Top