<?php
/*
@Author: Hannan_Mondul
php()
2014
*/
//use construct
class Car {
public $name;
public $band;
public $spreed;
public function __construct($name="Unkown",$band="Unkwon",$spreed=40){
$this->name = $name;
$this->band = $band;
$this->spreed = $spreed;
}
function output (){
printf("<p> This car name is %s and its band is %s and its spreed is %d per hour</p>",
$this->name,$this->band,$this->spreed
);
}
} // end class here
$bmw = new Car('Vison','BMW',100);
$bmw->output()
?>
Hannan_2 0 Newbie Poster

diafol
ryantroop 177 Practically a Master Poster
Alberto Bucur 0 Junior Poster
emmaharward789 0 Newbie Poster

diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.