Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. class User{
  3. //Wlasciwości
  4. public $na;
  5. public $name;
  6. public $email;
  7. public $numer;
  8. public $ul;
  9. public $kod;
  10. public $miasto;
  11. public $woje;
  12. //Konstruktory
  13. public function __construct($na,$name,$email,$numer,$ul,$kod,$miasto,$woje)
  14. {$this ->na=$na;
  15. $this ->name=$name;
  16. $this ->email=$email;
  17. $this ->numer=$numer;
  18. $this ->ul=$ul;
  19. $this ->kod=$kod;
  20. $this ->miasto=$miasto;
  21. $this ->woje=$woje;
  22. }
  23. //Metody
  24. public function pokaz()
  25. {echo $this->na.'<br/>';
  26. echo $this->name.'<br/>';
  27. echo $this->email.'<br/>';
  28. echo $this->numer.'<br/>';
  29. echo $this->ul.'<br/>';
  30. echo $this->kod.'<br/>';
  31. echo $this->miasto.'<br/>';
  32. echo $this->woje.'<br/>';
  33.  
  34. }
  35.  
  36. }
  37.  
  38. $jan=new User('Jan','Kowalski','kowalski@wp.pl','627542180','ul. Zlota 30','62-800','Kalisz','Wielkopolskie');
  39. $jan->pokaz();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement