Posted By

on 03/21/10


Tagged

class php


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

novatvstdios


Simple class example in PHP5


 / Published in: PHP
 

URL: http://bytes.com/topic/php/answers/698197-simple-example-how-wirite-php-using-classes

  1. class myClass
  2. {
  3. protected $message;
  4.  
  5. public function __construct()
  6. {
  7. $this->message = 'Hello, World!';
  8. }
  9.  
  10. public function echoMessage()
  11. {
  12. echo $this->message;
  13. }
  14. }

Report this snippet  

You need to login to post a comment.