How to create object from String?

devinclerk

New Member
I tried the code below:\[code\]$dyn = "new ". $className . "(" .$param1 . ", ". $param2 . ");";$obj = eval($dyn);\[/code\]It compiles but it's null.How can you instance object in PHP dynamicaly?
 
Back
Top