Re: how to make a global scope array

From: Date: Fri, 25 Jul 2003 23:52:28 +0000
Subject: Re: how to make a global scope array
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-156962@lists.php.net to get a copy of this message
* Thus wrote Comex (ng@xemoc.cjb.net): > <20030725224852.1123.qmail@pb1.pair.com> > Jack Lee: > > //I have an array a[] like this: > > > > <?php > > $a[]=0; > > > > //How to define and use it in a function like this? > > > > function myfunc(something) > > { > > echo $a[0]; //got error here!!!! Notice: Undefined variable: > > > > } > > > >> > > //Thanks for any help.!!! > > global $a; Ouch! Sometimes I wish global didn't exist Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#156962) next »