Brief introduction:
After the 1970s, object-oriented programming (oriented programming, or OOP) became popular. OOP employs a completely different approach to the development of computer applications. In this approach, the program is not designed around the task to be solved, but rather around the object in question to be solved. The object model is established and the problem is scoped to different objects for processing.
Classes and objects;
Class is a kind of thing description, is abstract, conceptual definition;
An object is an entity that actually exists for that kind of thing, and thus is also called an instance
The process of creating an object is called creating an object, also known as instantiation.
PHP uses the keyword class to define a class. Class naming is usually capitalized with the first character, and then the first character of each word is concatenated in a convenient way to read
Here is a simple style of writing a subordinate sex and behavior:
Class person{//here is the attribute
public $id; Serial number
Public $name; Name
Public $birth; Birthday
Public $sex; Gender
Here is the Act
Public Function SetName ($name) {
$this->name= $name;
}
Public Function GetName () {
$this->name;
}
}
Initial knowledge of PHP object-oriented