Php function method for obtaining and checking the class name, function name, and method name. php function name_php tutorial

Source: Internet
Author: User
Php obtains and checks the class name, function name, and method name function method, and php function name. Function methods used by php to obtain and check the class name, function name, and method name. php function name 1. function_exists ()-ReturnTRUEifthegivenfunctionhasbeendefined2.is _ callable ()-checks the function methods for obtaining the php parameter, checking the class name, function name, and method name, and php function name

1. function_exists ()-Return TRUE if the given function has been defined
2. is_callable ()-check whether the parameter is a valid callable structure
3. class_exists ()-check whether the class has been defined
4. method_exists ()-check whether the method of the class exists

_ FUNCTION name (new in PHP 4.3.0 ). Starting from PHP 5, this constant returns the name (case sensitive) when the function is defined ). In PHP 4, the value is always lowercase letters.
_ CLASS name (new in PHP 4.3.0 ). Starting from PHP 5, this constant returns the name (case sensitive) when the class is defined ). In PHP 4, the value is always lowercase letters.
_ METHOD _ class METHOD name (new PHP 5.0.0 ). Returns the name (case sensitive) when the method is defined ).

Note: These constants have two underscores.

Get_class (class name); // Obtain the class name of the class where the current statement is located.
Get_class_methods (class name); // retrieves all the method names of the class name and forms an array
Get_class_vars (class name); // retrieves all the highlighted names of the class name and forms an array

Handler 1. function_exists ()-Return TRUE if the given function has been defined 2. is_callable ()-detection parameter...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.