<?php class User { //Declare class variables public $name; public $email; public $phone; //Define user-defined parameter-less constructor function User($name, $email, $phone) { echo "<h3>It is an user-defined constructor.</h3>"; $this->name = $name; $this->email = $email; $this->phone = $phone; } function display() { //Print the values of class variables echo "<p>Name: <font color="green">".$this->name."</font></p>"; echo "<p>Email: <font color="green">".$this->email."</font></p>"; echo "<p>Phone: <font color="green">".$this->phone."</font></p>"; } } //Create object $objuser = new User('Mir Sabbir','sabbir@gmail.com','01645627748'); //Call display function echo $objuser->display(); ?>