using extract inside an object

From: Date: Fri, 21 Jun 2002 11:57:00 +0000
Subject: using extract inside an object
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-103258@lists.php.net to get a copy of this message
Hi does anyone know how to use the function extract inside an object, so as the created variables become attributes of the object ? a little example to be more explicit :) I have the following array: Array ( [one] => 1 [two] => 2 ) that I would like to transform into the following object stdClass Object ( [one] => 1 [two] => 2 ) any idea ? I though I could use someway the function extract, for example by using the prefix "this->" class someObj { function someObj($someArray) { extract($someArray, EXTR_PREFIX_ALL, "this->"); } } but it doesn't work ! ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif

« previous php.general (#103258) next »