How to check if a method exists that contains a certain sub-string

Hey,

I know there are ways to check if a method exists by specifying the correct method name using method_exists(), but I was wondering if there’s a simple way to check if a method exists that contains a certain sub-string within its name.

Much thanks,

Bardi

Yep, use Reflection.

As AlienDev noted, you can use reflection or alternatively the get_class_methods function to get a list of the available methods which you can then inspect and see if any of their names contain your substring.

Thanks guys.