How to create an instance of an class and call a method on it, in this case?

galgoul

New Member
Problem: I need to dynamically call a class and a method of that class. The only thing I get is two strings:\[code\]$class = "MyClass";$method = "myMethod";\[/code\]How can I create an Instance of the class specified in $class and then call a method on that instance specified in $method?Like: \[code\]$instance = new MyClass;$instance->myMethod();\[/code\]
 
Back
Top