-2
<?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()


?>
5
Contributors
5
Replies
42
Views
3 Years
Discussion Span
Last Post by diafol
0

Perhaps if we ignore him, he'll go away. This user has a history of posting random code.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.