What is ->

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iLdn
Forum Newbie
Posts: 16
Joined: Sun Mar 14, 2010 5:04 pm

What is ->

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: What is ->

Post by requinix »

On the left is an object, on the right is something.

More about objects
Last edited by requinix on Wed Apr 07, 2010 3:03 pm, edited 1 time in total.
thinsoldier
Forum Contributor
Posts: 367
Joined: Fri Jul 20, 2007 11:29 am
Contact:

Re: What is ->

Post 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');
Warning: I have no idea what I'm talking about.
iLdn
Forum Newbie
Posts: 16
Joined: Sun Mar 14, 2010 5:04 pm

Re: What is ->

Post by iLdn »

Ok!! thank you very much!

now it's everything more clear ;)
Post Reply