Nice question!

You can use Eval() as:

$clsname = "myclass";
eval("\$inst = new $myclass;");
now $inst is an instance of myclass.

-elias
http://www.kameelah.org/eassoft

"rswfire" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> $var = "thisclass";
>
> $myclass = new $var;
>
> how can i make it recognize $var as a class name?
>
> thankz in advance...
>
> =====
> =====================================
>              [ rswfire ]
>
>   http://rswfire.swifte.net/
>   http://profiles.yahoo.com/rswfire
>
> =====================================
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to