Home >Backend Development >PHP Tutorial >PHP function method to obtain and check class name, function name, method name, PHP function name_PHP tutorial
1.function_exists() - Return TRUE if the given function has been defined
2.is_callable() - Check whether the parameter is a legal callable structure
3.class_exists() - Check whether the class has been defined
4.method_exists() - Check whether the method of the class exists
__FUNCTION__ Function name (newly added in PHP 4.3.0). Since PHP 5 this constant returns the name of the function as it was defined (case sensitive). In PHP 4 this value is always lowercase.
__CLASS__ The name of the class (new in PHP 4.3.0). Since PHP 5 this constant returns the name of the class when it was defined (case sensitive). In PHP 4 this value is always lowercase.
__METHOD__ The method name of the class (newly added in PHP 5.0.0). Returns the name of the method as it was defined (case-sensitive).
Note: These constants are preceded and followed by two underscores.
get_class(class name);//Get the class name of the class where the current statement is located
get_class_methods(class name);//Get all the method names of class name and form an array
get_class_vars(class name);//Get all highlighted names of class name and form an array