note 1806 deleted from session_register by sas
| From: | sas@php.net | Date: | Tue, 08 Aug 2000 12:52:08 +0000 |
| Subject: | note 1806 deleted from session_register by sas | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-636@lists.php.net to get a copy of this message | ||
Actually, <B>session_register(string)</B> declares a variable with local scope. If
you're in the main body of a script, 'local' scope is the same as global scope. If
you're in a function, however, the variable will only be defined within the function, so
you'll need to declare the variable you're registering as global on the first line of your
function, e.g.
<PRE>
function foo() {
global $bar;
session_start();
session_register('bar');
}
</PRE>