Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. <?php
  2. class Testclass{
  3.    
  4.     var $Values = array();
  5.    
  6.     public function ReturnValues(){
  7.        
  8.         $Arraycount = count($this->Values);
  9.        
  10.         print("<table style='width:400px;border:1px solid black;'>");
  11.        
  12.         for($i=0;$i<$Arraycount;$i++){
  13.             print("<tr><td style='width:50%;border-right:1px solid black;'>");
  14.             print(get_class($this->Values[$i]));
  15.             print("</td><td>");
  16.             print($this->Values[$i]);
  17.             print("</td></tr>");
  18.         }
  19.        
  20.         print("</table>");
  21.     }
  22. }
  23.  
  24.  
  25. class Username extends Testclass{
  26.    
  27.     var $Username;
  28.    
  29.     function __construct($_username){
  30.         $this->Username = $_username;
  31.     }
  32.    
  33.     public function __toString(){
  34.         if(isset($this->Username)) return (string)$this->Username;
  35.         else return (string)"No Username";
  36.     }
  37.    
  38. }
  39.  
  40. class Password extends Testclass{
  41.    
  42.     var $Password;
  43.    
  44.     function Password($_password){
  45.         $this->Password = md5($_password);
  46.     }
  47.    
  48.     public function __toString(){
  49.         if(isset($this->Password)) return (string)$this->Password;
  50.         else return (string)"No Password";
  51.     }
  52.    
  53. }
  54.  
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement