Hi everyone,
I'm having scope issues. Is there anyway to make a variable accessable across all functions.
Heres the senario:
global $var
$var = "hello"
function myFunction()
{
print "$var"; // prints hello
}
So thats fine, but when i do this:
global $var
$var = "hello"
function myFunction()
{
myPrintFunction();
}
function myPrintFunction()
{
print "$var"; // prints f*** all
}
theres the problem. I dont want to pass the variables as arguments in the function calls because the variables are part of a global configuration file, included at the beginning of the script.
Anyone got any ideas?
cheers,
steve