Re: GLOBAL reserved word

From: Date: Sun, 26 Sep 2004 16:23:35 +0000
Subject: Re: GLOBAL reserved word
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-197873@lists.php.net to get a copy of this message
Pahlevanzadeh Mohsen wrote:
Dears,We can introduce a external variable to our function with GLOBAL reserved word.same following : <? $n=3 function nn() { global $n; echo $n; }//end of func ?> But i need to introduce a array.Name of my array is month. I typed "global $month;".But it didn't work. Please guide me until i can use an external array. Yours,Mohsen.
It works, you have error somewhere else: <? $month= array('January', 'February', 'March'); function nn() { global $month; echo $month[0]; } nn(); ?>

« previous php.general (#197873) next »