Page 1 of 1

usage of $this

Posted: Wed Jul 09, 2008 5:55 am
by junjustkim
Hi to all

I know this is very simple question, I am new in this environment. I found out this code in the sample script and I don't know the meaning by using of "$this" and "@mysql_close" I know mysql_close but what's the use of (@) sign. Furtheremore could you give an idea how can I search this characteristics and usage.

thanks in advance

Re: usage of $this

Posted: Wed Jul 09, 2008 8:00 am
by Frozenlight777
The @ symbol stops errors from being displayed when calling a function. As far as ' $this-> ' is for accessing variables within a class. Hope that helps, maybe someone can show a better response.

Re: usage of $this

Posted: Wed Jul 09, 2008 9:40 am
by Eran
Just a small addition - $this represents the object you are in, from within an object scope. It can be used to access members, invoke methods or manipulate the object in different ways.

Re: usage of $this

Posted: Wed Jul 09, 2008 8:39 pm
by junjustkim
thank you so much for your immediate replied

Cheers
:P