Understanding of the PHP class

Source: Internet
Author: User
Tags learn php php class

Well, admit that you have no experience, only a little bit of programming experience, from the previous Lynda saw some of the JS video tutorial, so now learn PHP, which does not understand the concept of all the analogy to JS to understand it, ~ ~

Although not accurate, but as long as I can understand, fine in the next contact process slowly screening it ~ ~

PHP class, PHP class is understood as a collection of objects, you can define constants, properties and methods for this class;

Just like the following code in JS:

var myH1 = document.getElementById ("my-h1");

var message = myh1.innerhtml;

innerHTML is a property of the message;

Message is actually an object, he attributes string to this class;

Creating a new class in PHP is equivalent to creating a string class in JS, but you can define the properties and methods of the class yourself;

Metaphor is very inappropriate, but at least I understand, and then slowly change it ~ ~

Understanding of the PHP class

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.