Re: included file var scope

From: Date: Mon, 07 Apr 2008 14:56:05 +0000
Subject: Re: included file var scope
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-272637@lists.php.net to get a copy of this message
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, independent of the system that is being included. So basically I want to be able to include a file in my function while stepping out of the context of the function itself. E

« previous php.general (#272637) next »