Hello all,
I know to many experience programmer of which I am not will sound crazy. What does -> means in php, I have come across this in many codes and came up empty trying to research what this is?
Kindly explain.
Dave
What -> means in PHP
Moderator: General Moderators
-
nowaydown1
- Forum Contributor
- Posts: 169
- Joined: Sun Apr 27, 2008 1:22 am
Re: What -> means in PHP
Greetings. It means that you're trying to use a specific method or parameter on an object. For example:
Would call the start() method on the instantiated Car object.
Code: Select all
$myCar = new Car();
$myCar->start();
Re: What -> means in PHP
Hi it means you're using a property or method of a class so for example:
Code: Select all
$cat=new Cat();
$cat->meow(); // tell the cat to meow
print $cat->age; //print the cat's age
print $cat->name; //print the cat's name
print $cat->fleas[0]->name //print the name of the first of the cat's fleas.
$cat->scratch();