Re: defining vars within functions as global

From: Date: Fri, 06 Sep 2002 04:02:54 +0000
Subject: Re: defining vars within functions as global
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-115396@lists.php.net to get a copy of this message
Justin French wrote:
<? function foo()
    {
    $foo = "aaa";
    $bar = "bbb";
    }
foo(); echo $foo; echo $bar; ?> How to I specify that $foo and $bar (defined in the func) are to be set globally (ie, outside the function)?
Why not use an include instead of a function? Joe

« previous php.general (#115396) next »