I’m loading a class dynamically in PHP. This file and class name are gotten out of the database. This file must contain a class and a method. I tried to solve it with an interface, but I don’t really get it how I could do it the most beautiful way.
What would be your suggestions?
Use
class_exists()to determine if a class has been defined,method_exists()to determine if a class has a method andinstanceofto determine if a class implements an interface.