Variables declared and defined outside of a function are global. However, in order to use them within a function, you have to declare them as global within that function.
eg.
$var1 = "hello";
function foo() {
global $var1;
return $var1;
}
echo foo();
This will return "hello" (sans quotes, of course). But if you forgot to defind $var1 as global (notice the first line of the function global $var1), it would return nothing. It then would assume it is trying to access a variable in the local scope of that function.
As well, if you declare a variable within a function, it is local to that function, and cannot be called to from outside that function.
Of course, none of this applies to superglobals.