Re: Variables scope question

From: Date: Thu, 04 Dec 2003 11:13:00 +0000
Subject: Re: Variables scope question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-171796@lists.php.net to get a copy of this message
Mike, It depends what you mean by local scope. If you declare the variable as global, it should be available to the code inside include1.txt and index.php. It will not be available to other pages however (i.e. it is not session global). To create a truly global (available to all pages in the site) variable, you should use a session variable. Regards, Steve "Mike D" <mike@awn.com> wrote in message news:BBF3B319.DEEB%mike@awn.com... > Hello, > > I have recently noticed something that I wasn't aware of until now. I have > index.php which contains include1.txt and include2.txt. If a variable is set > in include1.txt it will *only* have a local scope, even if I declare it > GLOBAL. Is this normal or a bug? > > - MD > > .................................... > Mike Dunlop > AWN, Inc. > // www.awn.com > [ e ] webmaster@awn.com > [ p ] 323.606.4237

« previous php.general (#171796) next »