Re: [PHP] included file var scope

2008-04-08 Thread Németh Zoltán
> >> In index.php rather than declaring vars like so... >> >> $var = 'value'; >> >> ...declare them in the $GLOBALS array like so... >> >> $GLOBALS['var'] = 'value'; >> >> $var is then in the global scope regardless of where it was set. >> >> -Stut >> > > That would work. However I'm looking for a

Re: [PHP] included file var scope

2008-04-07 Thread Evert Lammerts
I'm not sure what you mean. If you're saying you want to include a file from inside a function but for all parts of it to behave as if it were being included at the global scope then I don't believe there's a way to do it. Maybe it would be better if you tell us exactly what you're trying to

Re: [PHP] included file var scope

2008-04-07 Thread Stut
Evert Lammerts wrote: In index.php rather than declaring vars like so... $var = 'value'; ...declare them in the $GLOBALS array like so... $GLOBALS['var'] = 'value'; $var is then in the global scope regardless of where it was set. -Stut That would work. However I'm looking for a more gen

Re: [PHP] included file var scope

2008-04-07 Thread Evert Lammerts
In index.php rather than declaring vars like so... $var = 'value'; ...declare them in the $GLOBALS array like so... $GLOBALS['var'] = 'value'; $var is then in the global scope regardless of where it was set. -Stut That would work. However I'm looking for a more generic solution, indepen

Re: [PHP] included file var scope

2008-04-07 Thread Stut
Evert Lammerts wrote: My system is accessible through an index.php file. This file does a bunch of includes to include global variables, which in function context become available through the global keyword: index.php However, apart from access through the index.php file I want to be able

[PHP] included file var scope

2008-04-07 Thread Evert Lammerts
Hi all, My system is accessible through an index.php file. This file does a bunch of includes to include global variables, which in function context become available through the global keyword: index.php However, apart from access through the index.php file I want to be able to include my