Re: Retrieving values from array on a class

From: Date: Sat, 14 Oct 2006 17:37:31 +0000
Subject: Re: Retrieving values from array on a class
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-243140@lists.php.net to get a copy of this message
# lists@tuxdoit.com / 2006-10-14 16:28:57 +0100: > Hello, > > >> I have this class named "returnConfigParams" that returns an array > >> called "$values" through a function called "getMySQLParams()". > >> > >> My question is how to retrieve the values of the array from the file > >> that calls the class. > >> > >> I have: > >> > >> $params_file = New returnConfigParams; > >> $params_file->getMySQLParams(); > >> print($params_file[0]); > > > > var_dump($params_file->getMySQLParams()); > > > > You said the method returns the data, right? > Yes, it returns an array called $values. > My problem is how to access the individual member of the array. Just like you'd access members of any other array. $whatever = $params_file->getMySQLParams(); print($whatever[0]); This is a matter of basic rules of the language. Did you know most of the grammer is described in the manual? http://www.php.net/manual/en/langref.php -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991

« previous php.general (#243140) next »