if
global $var;
is called from within a function and $var exist outside the nested function
then the $var will be available to the function.
example
$var = "hello world";
function say_hello() {
global $var;
echo $var;
}
will echo "hello world"
while
$var = "hello world";
function say_hello() {
echo $var;
}
wont echo "hello world"
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--------------------------
----- Original Message -----
From: "jacky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 30, 2001 11:40 AM
Subject: [PHP] session and global
Hi folks
I just wonder as I saw someone useing session with global and some don't.
What is the reason to use session together with global?
Like this:
session_start();
global $test
session_register('test');
I look up in manual using keyword "global", but could not find anything near
this.
Jack
--
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]