Call class methods directly : Class Method : Class PHP Source Code


PHP Source Code » Class » Class Method »

 

Call class methods directly




<?php
   class Visitors
   {
      public function greetVisitor()
      {
         echo "Hello<br />";
      }

      function sayGoodbye()
      {
         echo "Goodbye<br />";
      }
   }

   Visitors::greetVisitor();
   $visitor = new Visitors();
   $visitor->sayGoodbye();
?>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Class
» Class Method