You are here: Re: Can someone explain ($this->varname) to me.. « PHP Programming Language « IT news, forums, messages
Re: Can someone explain ($this->varname) to me..

Posted by Tony Marston on 09/03/07 15:52

"stiki" <laptopia@gmail.com> wrote in message
news:1188582269.180135.221550@q4g2000prc.googlegroups.com...
> How and what does this mean in php: ($this->varname)
>
> I can't seem to find this by searching Google, because the "->" are
> removed from my search query.
>
> Cheers,
> Igor Terzic
> www.stikimedia.com
>

$this->varname refers to a class variable (property) which is available to
any function (method) within that class. This is not to be confused with
$varame which refers to a variable whose scope is limited to the current
method.

$this->function() refers to another function (method) within the same class,
as opposed to function() without $this->) which refers to a non-class method
which exists in global scope.

Basically $this-> is used within a class method to refer to something else
which exists within the same class.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация