Home > Backend Development > PHP Tutorial > PHP function method to obtain and check class name, function name, method name, PHP function name_PHP tutorial

PHP function method to obtain and check class name, function name, method name, PHP function name_PHP tutorial

WBOY
Release: 2016-07-13 09:48:43
Original
895 people have browsed it

php function method to get and check class name, function name, method name, php function name

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1022309.htmlTechArticlephp function method to get and check class name, function name, method name, php function name 1.function_exists() - Return TRUE if the given function has been defined 2.is_callable() - Detect parameters...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template