Hi,

Am I missing something? I'm trying to use vars set in my config.php file in
a function, and can't seem to do it without using $GLOBALS["varname"], which
is a bit of a pain in the....

---config.php---
$var1 = 1;
---

---something.php---
function foo
    {
    if($var1)
        {
        echo "foo"; // doesn't work
        }
    }

function foo2
    {
    if($GLOBALS["var1"])
        {
        echo "foo"; // does work
        }
    }
---

Is there a way to make global vars available in each function, or is this
just the way things go?


Justin French
---------------------
http://indent.com.au
http://soundpimps.com
---------------------




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to