PHP-php Tutorial

Source: Internet
Author: User
PHP learning class:
1. similar objects are classified into a class by means of classification.
2. the class defines the same attributes and methods of these similar objects.
3. the class object is called an instance of the class.
4. class attributes and methods are collectively called class members.


Implement through a class
1. how to define a class
2. how to instantiate class objects

3. how to call class methods

 A ."
"; // Obtain the class method echo $ ceshi-> ceshifunction ()."
";?>
4. constructor
5. destructor

 A = $ info} // destructor. when the execution ends, when the variable is null, run the // destructor, which is usually used to clean up the resource function _ destruct () {echo "program execution ends ". $ this-> a;} // define the method. function ceshifunction () {echo "this is a test method ";}} // class instantiation $ ceshi = new ceshi ('Another variable '); // Obtain the attribute value echo $ ceshi->."
"; // You can trigger the destructor $ ceshi = null by setting the variable to null; // Obtain the class method echo $ ceshi-> ceshifunction ()."
";?>

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.