Advertisement
touhid_xml

PHP Interface

Apr 23rd, 2013
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. class A{
  3.     protected $choise = "I love apple";
  4.     public function display(){ 
  5.     print "{$this->choise} <br />\n";
  6.     }
  7.  
  8. }
  9. class B extends A{
  10.     protected $name = "Md. Touhidul Islam Touhid";
  11.     protected $address = "Dianjpur, Bangladesh";
  12.     protected $job = "Programmer";
  13.    
  14.    
  15.     public function MyInfo(){
  16.        
  17.         print $this->name."<br />\n";
  18.         print $this->address."<br />\n";
  19.         print $this->job."<br />\n";
  20.        
  21.     }
  22. }
  23. class C extends B implements MyInterface{  
  24. }
  25. interface MyInterface{
  26.     public function display();
  27.     public function MyInfo();  
  28. }
  29. $obj = new C();
  30. $obj->display();
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement