Re: Using variable content to name a class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave M G wrote:
> Chris,
> 
> Thank you for replying.
>>> $object = new $className();
>>> Is this possible?
>> If in doubt, test it out ;)
>> Yes, it will work.
> Oh, that's actually the code I can use? I just wrote it as an
> explanatory aid, not thinking that it could be literally done like that.
> I assumed there was a specific command I was missing.
> 
> Well, anyway, I guess I've stumbled on the right syntax. Thank you for
> pointing it out to me.

also check out call_user_func() and call_user_func_array() - you might
find them handy in certain situations.

> 
> -- 
> Dave M G
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux