Re: Retrieving values from array on a class

From: Date: Sun, 15 Oct 2006 00:09:58 +0000
Subject: Re: Retrieving values from array on a class
Groups: php.general 
Request: Send a blank email to php-general+get-243154@lists.php.net to get a copy of this message
Hello, I've rewritten my class as you told me: ---------------------------------------------------------- class returnConfigParams { private static $instance = NULL; var $a; var $b; var $c; var $d; private function __construct() { } // function that get the database parameters from "properties.php" public static function getInstance() { if (!self::$instance) { /*** set this to the correct path and add some error checking ***/ include($_SERVER['DOCUMENT_ROOT']."/properties.php"); self::$instance = array($a, $b, $c, $d); } return self::$instance; } private function __clone(){ } } ---------------------------------------------------------- and i'm calling it with returnConfigParams::getInstance(); (probably wrongly) The question is how to access the individual elements of the array. Can someone help me please ? Cheers, AR

« previous php.general (#243154) next »