I want to call a class object, being the class name a given parameter

Posted by user216040 on Stack Overflow See other posts from Stack Overflow or by user216040
Published on 2010-03-30T09:49:34Z Indexed on 2010/03/30 9:53 UTC
Read the original article Hit count: 215

Filed under:
|
|

Hi,

I want to do something like this: (in php)


$a = "class_name1";

$b = "class_name2";

$object1 = new $a;

$object2 = new $b


is this possible?

thank you very much for your time

© Stack Overflow or respective owner

Related posts about php

Related posts about classes