OOP
http://php.net/manua...ef.classobj.php
$this is only used in objects, not functions. I just looks like it's used in functions because you define functions within classes. The examples php.net has aren't the best to learn from (trust me, i tried), but they do get some of the basics across.
Note: this also exists in JavaScript (and many other programming languages). In JS it referes to the current object or element that is calling something, i.e.
<table>
<tr>
<td onMouseOver="changeBG(this, 1);" onMouseOut="changeBG(this, 0);">changeBG is an imaginary function that would highlight the table cell</td>
</tr>
</table>
Thats at least the best example i can use to get across what $this is used for. I also remember reading a better real life example of how OOP is used, i'll see if i can find it later.