How can I use session variable in a function?
| From: | Zenith | Date: | Mon, 19 Feb 2001 13:42:52 +0000 |
| Subject: | How can I use session variable in a function? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-40570@lists.php.net to get a copy of this message | ||
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.?