Re: get object by class name

From: Date: Wed, 07 May 2003 13:15:19 +0000
Subject: Re: get object by class name
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-146665@lists.php.net to get a copy of this message
The only way I can think of is to loop $GLOBALS and do this check: foreach($GLOBALS as $key => $val) { if(is_object($val) && get_class($val) == 'YourClassName' ){
      // $GLOBALS[$key] is your desired object
} } Stefan Textor wrote:
Hi, is there any possibility to get an object by its class name? Thank you very much in advantage. Stefan


« previous php.general (#146665) next »