class and object in php code example
Example 1: php define class
class Bike {
function Bike() {
$this->type = 'BMX';
}
}
$blackSheep = new Bike();
print $blackSheep->type;
Example 2: php define object
$x = new stdClass();
Example 3: how to make php oop class
public className{
public function __construct(){
//CODE HERE
}
}