Re: How can I use session variable in a function?

From: Date: Mon, 19 Feb 2001 22:09:12 +0000
Subject: Re: How can I use session variable in a function?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40652@lists.php.net to get a copy of this message
You'll still need to declare any variables global. Session variables are not inherently global or otherwise special to a function. And that's a feature, not a bug. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm ----- Original Message ----- From: "Zenith" <zenith@linuxmail.org> Newsgroups: php.general Sent: Monday, February 19, 2001 7:35 AM Subject: [PHP] How can I use session variable in a function? > In main.php, > then I use include("xxx.php"), in which, there is a function called temp(); > If I use session_start() at the beginging of main.php, after include > statment, > and I cal the temp(), will the temp() function can get the session variable > I have? > Or I need to import it by using "global" in the function def.? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#40652) next »