dear all, i have a code in php class. through that code plz help me to solve my problem. in the below code why we use $this->message .. can't we use $message under constructor? plz pl ztell me
thanks
myClass.php
<?php
class myClass
{
public $message;
public function __construct()
{
$this->message = 'Hello, World!' ;
}
public function echoMessage()
{
echo $this->message;
}
}
$obj = new myClass;
echo $obj->message;
?>