scope refers to where a variable resides.
there is GLOBAL scope meaning available to the entire script..
scope within functions (only functions have access to it)
(im unsure about the rest.. too tired to research lol)
You can have a variable outside of a function and have one WITHIN a function having the SAME name WITHOUT them having anything to do with one another:
$var = "foo";
function myfunc(){
$var = "bar";
}
myfunc()
echo $var;
displays:
foo
though if you declare a variable as being of GLOBAL scope within a function, it treats it as if it were part of the entire script.
$var = "foo";
function myfunc(){
global $var;
$var = "bar";
}
myfunc()
echo $var;
displays:
bar
(untested but it probably works ;)
Snoochie Boochies