Advertisement
Guest User

Untitled

a guest
Jan 6th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <?php
  2.  
  3. class person {
  4.  
  5. public $name, $age, $email;
  6.  
  7. public function __construct($name, $age, $email) {
  8. $this->name = $name;
  9. $this->age = $age;
  10. $this->email = $email;
  11. }
  12.  
  13. public function details() {
  14. return 'Your full name is ' . $this->name . '<br>' .
  15. 'And you are ' . $this->age . ' years old<br>' .
  16. 'Your email is ' . $this->email;
  17. }
  18.  
  19. }
  20.  
  21. $obj = new person('Rimon Babu', 23, 'rimonbabu101@gmail.com');
  22. echo $obj->details();
  23. echo '<br>';
  24. $obj = new person('Murad Khan', 22, 'muradkhan@gmail.com');
  25. echo $obj->details();
  26. echo '<br>';
  27. $obj = new person('Jobair Islam', 21, 'jobairislam@gmail.com');
  28. echo $obj->details();
  29. echo '<br>';
  30. $obj = new person('Jewel Ahmmed', 26, 'jewelbdx@gmail.com');
  31. echo $obj->details();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement