Variable scope problem
| From: | Joe Nelson | Date: | Thu, 29 Mar 2001 02:16:32 +0000 |
| Subject: | Variable scope problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45989@lists.php.net to get a copy of this message | ||
I have two functions like the ones below. If the first one creates a
variable as global, shouldn't it be accesible to the second function?
function setGlobal() {
global $test;
$test = "123";
}
function getGlobal() {
global $test;
echo $test;
}