PHP Tutorials
PHP Forms
PHP Advanced
PHP OOP
From PHP5, you can rewrite PHP code in object-focused style.
Object-oriented planning is quick and easy to use.
OOP stands for Object-Oriented Programming.
Process planning is about writing processes or tasks that perform tasks in data, while object-focused planning is about creating objects that contain both data and functions.
Object-oriented planning has fewer benefits than process planning:
Tip: The "Do Not Repeat" (DRY) policy is about reducing code duplication. You have to extract the standard codes in the app, and put them in one place and reuse them instead of repeating them.
Classes and objects are two main elements of an object-focused program.
Look at the following picture to see the difference between class and objects:
Fruit
Apple
Banana
Mango
Another example:
Car
Volvo
Audi
Toyota
So, the class is a model of things, and the object is a model of the class.
When each item is created, it inherits all the features and behaviors in the classroom, but each item will have a different set of properties.
See the following chapters to learn more about OOP.