Syntax Question

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
rkittleberger
Forum Newbie
Posts: 2
Joined: Wed Apr 11, 2012 6:31 am

Syntax Question

Post by rkittleberger »

Alright guys, a bit of a noob here, and this question might have a simple answer (it also might be in the wrong place, not totally familiar with the forums yet), but here goes...

In PHP what exactly does the "->" operator do? Here's an example...

Code: Select all

<?php
$datagrid -> init( );
?>
Thanks in advance!
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Syntax Question

Post by social_experiment »

By using -> you can access the methods and properties of an object. $datagrid in this instance is an object and init() is a method (function) inside the class.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
rkittleberger
Forum Newbie
Posts: 2
Joined: Wed Apr 11, 2012 6:31 am

Re: Syntax Question

Post by rkittleberger »

Got it. Thanks for the reply!
Post Reply