fursty

WEB Lab8_2 up1

Apr 2nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <HTML>
  2. <title> lab8 </title>
  3. <BODY>
  4.  
  5. <?php
  6.  
  7. class Books
  8. {
  9.     private $title;
  10.     private $author;
  11.     private $price;
  12.  
  13.     function __construct ($zaglavie, $avtor, $cena )
  14.     {  
  15.         $this->title = $zaglavie;
  16.         $this->author = $avtor;
  17.         $this->price = $cena;
  18.         }
  19.  
  20.         function show_article(){
  21.             $art = "Книга:".$this->title."," . $this->author.", ". $this->price;
  22.             echo $art;
  23.         }
  24.        
  25.  
  26.    
  27. }
  28.  
  29.  
  30. $newb=new Books("PHP Book","Ivan Ivanov", "12lv" );
  31. $newb->show_article();
  32.  
  33. ?>
  34.  
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment