Re: Stupid question
| From: | Luis Mirabal | Date: | Wed, 17 Mar 2004 21:02:12 +0000 |
| Subject: | Re: Stupid question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180746@lists.php.net to get a copy of this message | ||
when you are working with classes and objects in php, and you are coding
inside a class, you must use the $this variable to access the members of the
class, for example:
class test {
//Class vars (something like properties)
var $a;
var $b;
var $c;
var $sum;
//Class function (Constructor)
function test() {
$this->a = 'value for a';
$this->b = 'value for b';
$this->c = 'value for c';
$this->set();
}
//Class function
function set() {
$sum = $this->a . $this->b . $this->c;
}
} //end class
luis.