Web Development:Object-Oriented PHP :: [classes, properties, and methods]

While programming, the same kind of work is not a good strategy, repeatedly writing the same code over and over again. It increases the number of lines of code, such as the increased complexity and execution time. Object-oriented programming is to solve this problem. We php web programming language to learn  
 object-oriented programming techniques. of the working class by creating groups of similar methods of  


programming the object-oriented programming. One of the same kind of work is called a group class.
Object-oriented programming is the primary topic of contents

     class (Class)
     property (Property)
     method (Method)
     object (object)
     And the object instance (object instances)

 how to declare class?

liokha class class name to enter the keyword {}. {} Are the property and method services. An example of such a class.

Location of the property and method of class
 public $ count = 'default value of property';

A property of a class must be declared.

public function displayValue () {

echo $ this-> count;

}

Refers to a method. Method is a type of function.

No comments:

Post a Comment