If you have already register Login here.
What is object in php
Objects or Instances can be created for a class to access the class components. The below PHP code shows how to create an object to the Car() class and it is used to access the class components.
Example Of Objects
class Car{
private $carModal = "Alto";
public function getModal() {
return $this->carModal;
}
}
$carObj= new Car();
echo "<b>Car Modal:</b> " . $carObj->getModal() . "<br/>";
© 2023 Easy To Learning. All Rights Reserved | Design by Easy To Learning