Home > Article > Backend Development > How to determine whether a class method exists in php
In PHP, you can use the "class_exists" function to determine whether a class method exists. The syntax is "bool class_exists (string $class_name [, bool $autoload = true ])".
php determines whether the class exists
bool class_exists ( string $class_name [, bool $autoload = true ] ) Checking whether a class has been defined must return true, otherwise false, for example:
if(class_exists('MySQL')){ $myclass=new MySQL(); }
For more related knowledge, please visit PHP Chinese website!
The above is the detailed content of How to determine whether a class method exists in php. For more information, please follow other related articles on the PHP Chinese website!