What does this syntax do or mean?

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
Markto
Forum Newbie
Posts: 22
Joined: Thu Nov 17, 2011 1:13 pm

What does this syntax do or mean?

Post by Markto »

I frequently encounter this syntax, but I don't know what it does or mean, so I am having difficulty looking it up.

it involves the "->" symbol and is usually something like

$variable->isfunction()

or maybe

$variable1->$variable2

I could be using it wrong here. Can someone explain this to me and what this syntax is supposed to do?
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: What does this syntax do or mean?

Post by Eric! »

Check out Ojects and how to use their methods/etc.
mixahlos
Forum Newbie
Posts: 1
Joined: Sun Nov 20, 2011 4:49 pm

Re: What does this syntax do or mean?

Post by mixahlos »

"$variable" is an Object ( Objects are defined as Classes )
"isfuction()" is a method (function) of the class $variable.
"->" is the way to acces a property (variable) or method (function) of a class.
so this code,
is calling the function of the object.

Eric! posted the link to read aabout Objects ;)
Post Reply