Re: Question on functions

From: Date: Wed, 10 Nov 2004 14:18:49 +0000
Subject: Re: Question on functions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-201669@lists.php.net to get a copy of this message
John Holmes wrote:
Jason wrote:
My question is in regard to passing global variables to a function. Here is my code, any idea why it is not working? I suppose my understanding of a global variable being able to be used within a function is off? global $array = array( "0" => "hostname", "1" => "username", "2" => "password" ); function database() {
You need to declare it global within the function... function database() { global $array; ... thanks, it figures it is something easy like that... =)
-- Jason Gerfen jason.gerfen@scl.utah.edu "And remember... If the ladies don't find you handsome, they should at least find you handy..." ~The Red Green show

« previous php.general (#201669) next »