How to explain 'this' keyword in a best and simple way?

azgaroth

New Member
I am using 'this' keyword for a long time. But when someone asks me to explain it, I am confused that how to explain it. I know that I can use this in a method of class to access any variable and method of the same class.\[code\] class MyClass{ function MyMethod1(){ echo "Hello World"; } function MyMethod2(){ $this->MyMethod1(); } }\[/code\]Is it a object of a class that we don't need to initialise and can be used only within the class or anything else. How to explain? Thanks
 
Back
Top