OOPs stand for object oriented programming.
Object oriented is a method which can contain both data and method.
OOPs concept has several advantages :
Class:
Class is a collection of objects It doesn't take any spaces. Example: Bike, Car, Fruit
Object:
An entity that has state and behavior is known as an object e.g., chair, bike, marker, pen, table, Apple etc.
Example:
Bike
Kawasaki
Ducati
Harley-Davidson
<?php
class Bike {
/* Member variables */
var $price;
var $title;
/* Member functions */
function setPrice($par){
$this->price = $par;
}
function getPrice(){
echo $this->price ."<br/>";
}
function setTitle($par){
$this->title = $par;
}
function getTitle(){
echo $this->title ." <br/>";
}
}
?>