In the first part of this tutorial about Object Oriented Programming with PHP, we defined what was the concept of an
You should also know that
attributes of an object in OOP is similar to attributes of real life objects (like the color of our cars in the example of the first part).
And, that objects in OOP have
methods, which are basically actions that they can execute. Much like our car could move, turn, honk, etc.
If you didn’t read it or if you read it last week, I suggest that you re-read part 1 before reading this part, just so that the concepts are fresh to your memory.
In this part, you will learn:
- How to create a
class with PHP code
- How to add
methods to that class
- How to instantiate an
object based on a
- How to change the value of the
attributes of an