PHP functions: method_exists and function_exists. Method_exists check whether the method of the class has bool (,) check whether the method of the class exists in the specified object. parameter: object example or class name method_name: method name return value method_exists
Check whether the class method exists
bool ( , )
Check whether the class method exists in the specified object.
Parameters:
Object: object example or class name
Method_name: method name
Return value:
If the method referred to by method_name has been defined in the object class referred to by the object, TRUE is returned; otherwise, FALSE is returned.
Note:
If this class is not a known class, use this function to use any registered autoloader.
Function_exists
Returns TRUE if the provided method has been defined.
bool ( )
Check the list of defined methods, including built-in (PHP internal) and user-defined methods.
Parameters:
Method name, string type.
Return value:
If the method name exists and is a method, TRUE is returned; otherwise, FALSE is returned.
Note:
This function will returnFALSE
For constructs, such as include_once and echo.
The http://www.bkjia.com/PHPjc/440152.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/440152.htmlTechArticlemethod_exists checks whether the method of the class has bool (,) checks whether the method of the class exists in the specified object parameter: object example or class name method_name: method name return value...