You are here: Re: PHP « All PHP « IT news, forums, messages
Re: PHP

Posted by Christoph Burschka on 11/14/06 08:50

Blackhawk@idonthaveone.com schrieb:
> Can someone help me please
>
> I have been playing with PHP for some time but I never ran across code
> like this.
>
> function addGuestBookEntry() {
> $entry = $this->_createEntryHTML();
> if (!$entry) return false;
> $this->data = $entry.$this->data;
> return $this->_writeDataFile();
>
> what is the " ->" doing in the sample above?
> Is that a form of piping the data?

$a->b indicates that b is a member of object a. It's the PHP equivalent
of "." in Java.

In PHP, all object members must be referred to with their parent object,
even inside their own functions. That would be $this->function() or
$this->variable.

(Note that "->" is only used for objects. Static members of a class are
referred to with ClassName::member)

 

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

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