You are here: Re: instanciate class from array « PHP Programming Language « IT news, forums, messages
Re: instanciate class from array

Posted by gosha bine on 06/25/07 14:46

On 25.06.2007 16:35 PaowZ wrote:
> Hello there!
>
> I'm searching a way to instanciate php5 class which names are
> contained in a array.
> Something like:
> $class_name = myArray['class'] ;
> $object = new $class_name()... of course, this syntax won't work..

Just try it. ;)



> that was just to explain :)
> I use the magic __autoload function to include required classes, but I
> can't find a way to instanciate a class from a string contained in a
> array..
> any idea ?
>
> thanks a lot :)
>


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация