Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class person {
- public $name, $age, $email;
- public function __construct($name, $age, $email) {
- $this->name = $name;
- $this->age = $age;
- $this->email = $email;
- }
- public function details() {
- return 'Your full name is ' . $this->name . '<br>' .
- 'And you are ' . $this->age . ' years old<br>' .
- 'Your email is ' . $this->email;
- }
- }
- $obj = new person('Rimon Babu', 23, 'rimonbabu101@gmail.com');
- echo $obj->details();
- echo '<br>';
- $obj = new person('Murad Khan', 22, 'muradkhan@gmail.com');
- echo $obj->details();
- echo '<br>';
- $obj = new person('Jobair Islam', 21, 'jobairislam@gmail.com');
- echo $obj->details();
- echo '<br>';
- $obj = new person('Jewel Ahmmed', 26, 'jewelbdx@gmail.com');
- echo $obj->details();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement