Learning PHP and MySQL

Example 05-13 Defining three member functions for Cat

<?php
Class  Cat  {
  
//  Constructor 
  
function  Cat()  {
  }

  
//  The  cat  meows 
  
function  meow()  
    
echo  "Meow...";
  
}

  
//  The  cat  eats 
  
function  eat()  
    
echo  "*eats*";
  
}

  
//  The  cat  purrs 
  
function  purr()  
    
echo  "*Purr...*";
  
}
}
?>

Posted by on 08/03 at 08:22 AM

Next entry: Example 05-14 Creating a new object without saving the reference

Previous entry: Example 05-12 Using the PHP 5 style constructor

<< Back to main