Page 1 of 1

What is ->

Posted: Wed Apr 07, 2010 12:29 pm
by iLdn
Yes, i know.. it's a very stupid question but i really don't know what -> is used for in php? or Better to say i think what is his function, but i'm not sure :)

so, php guru, can you help me :)?

thanks

Re: What is ->

Posted: Wed Apr 07, 2010 1:00 pm
by requinix
On the left is an object, on the right is something.

More about objects

Re: What is ->

Posted: Wed Apr 07, 2010 1:04 pm
by thinsoldier
-> is use when working with objects.

It's the equivalent of " . " in java or javascript.

It's how you access a method/function or property/value that belongs to (is inside of) the object.

In javascript:
var node = document.getElementById('header');

In php:
$dom = new DOMDocument();
$node = $dom->getElementById('header');

Re: What is ->

Posted: Wed Apr 07, 2010 2:04 pm
by iLdn
Ok!! thank you very much!

now it's everything more clear ;)