problem about a scope of varibales
| From: | ashok chauhan | Date: | Sat, 29 Sep 2001 06:16:35 +0000 |
| Subject: | problem about a scope of varibales | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-69255@lists.php.net to get a copy of this message | ||
hi all,
i am in trouble so please help me if possible what is wrong in this code
<?php
$GlobalVariable = "Global";
function local()
{
$LocalVariable="Local";
static $StaticVariable=0;
echo "<BR>The contents of GlobalVariable are $GLOBALS[GlobalVariable]";//i have
found an error in //this line
echo "<BR>The contents of LocalVariable are $LocalVariable";
echo "<BR>The contents of StaticVariable are $StaticVariable";
return $StaticVariable=$StaticVariable+1;
}
echo "<B>Calling Our function for the first time...</B>";
local();