Reputation: 5086
Assuming the following class
class test {
public $x = 2;
public testFunction() {
//...
}
}
Is there any way I can access $x from within testFunction()?
Thanks! :)
Upvotes: 0
Views: 45
Reputation: 6342
Absolutely, simply using $this->x
You may wish to brush up on PHP's OOP principles.
Upvotes: 0