Basic Public / Private Function Call


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class Visitors
  2. {
  3. public function greetVisitor()
  4. {
  5. echo "Hello<br />";
  6. }
  7.  
  8. function sayGoodbye()
  9. {
  10. echo "Goodbye<br />";
  11. }
  12. }
  13.  
  14. Visitors::greetVisitor();
  15. $visitor = new Visitors();
  16. $visitor->sayGoodbye();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.