Is it possible in PHP to instantiate an object from the name of a class, if the class name is stored in a string?
+8
A:
Yep, definitely.
$className = 'MyClass';
$object = new $className;
brianreavis
2009-09-04 03:29:17
Cool, I should've tested that before asking hehe. Thanks!
2009-09-04 03:34:15