I know its old question, anyway another exact explanation about $this. $this is mainly used to refer properties of a class.
Example:
Class A
{
public $myname; //this is a member variable of this class
function callme() {
$myname = 'function variable';
$this->myname = 'Member variable';
echo $myname; //prints function variable
echo $this->myname; //prints member variable
}
}
output:
function variable
member variable