In this lesson, we will be learning about classes and how to define them.
We define our own class by starting with the keyword class followed by the name you want to give to your new class.
class
Here’s the general syntax:
class className{ //properties and methods defined}
Here’s an example snippet of a class named Shape.
Shape
<?phpclass Shape{ public $sides = 0; // first property public $name= " "; // second property public function description(){ //first method echo "A $this->name with $this->sides sides."; }}?>