Classes
Classes
Classes are the blueprint of objects. Classes hold their own data members and member functions, which can be accessed and used by creating an instance of that class. In PHP class is defined using the class keyword, followed by the name of classes and curly braces ({}).
Example:
Creating a Class in PHP
We will create a class Employee where we will have two properties and two methods for setting and getting the property.
Note: The $this keyword refers to the current object, and is only available inside methods.