Possible Duplicate:
What does the variable $this mean in PHP?
I know this is extremely basic. I am watching tutorials on YouTube about CakePHP and PHP and all of them keep using "$this", but none of them actually say what it is or what it is used for. I think it is a variable, but what does it contain, and why do all of the functions have to be run from it? Is it the current class? I read here that "$this" is different from self though, so I am not sure if this is the case.
$this refers to the instance of the class (a.k.a. object). self is more or less the same, but for static classes.
I suggest you to read http://php.net/oop in particular this section http://www.php.net/manual/en/language.oop5.basic.php
if used in a class,
$this
refers to the object that it's in.