Possible Duplicate:
Reference - What does this symbol mean in PHP?
What exactly does -> do in php?
I have a good understanding of the basics of php but never understood this. I tend to see in apps that use Codeignitor.
It accesses accessible child methods or properties of objects:
class myClass {
public $fizz = 'Buzz';
public function foo() {
echo 'Bar';
}
}
$myclass = new myClass();
$myclass->foo(); // outputs 'bar'
$myclass->fizz = 'Not Buzz'; // overwrites $fizz value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With