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" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to