tqla Posted January 21, 2009 Share Posted January 21, 2009 Sorry in advance for what I am sure is a dumb question but I am seeing code like this a lot: $this-> $var $cart-> updateCart($var) $e -> getMess() Specifically, what is this " -> "? I haven't used it at all in my projects. ??? ??? ??? Link to comment https://forums.phpfreaks.com/topic/141722-solved-what-is-this/ Share on other sites More sharing options...
jkewlo Posted January 21, 2009 Share Posted January 21, 2009 I have wondered that as well Link to comment https://forums.phpfreaks.com/topic/141722-solved-what-is-this/#findComment-741909 Share on other sites More sharing options...
Zane Posted January 21, 2009 Share Posted January 21, 2009 It is used in what is called a Class class Dog { public $name = "Roger"; public $color = "brown"; function bark() { echo "Woof"; } function growl() { echo "GRRRRrrr"; } function showName() { echo $this->name; } } $myDog = new Dog(); $myDog->bark(); $myDog->growl(); $myDog->showName(); //This echoes Roger $myDog->name = "Jesus"; $myDog->showName(); // This echoes Jesus echo $myDog->color; Link to comment https://forums.phpfreaks.com/topic/141722-solved-what-is-this/#findComment-741911 Share on other sites More sharing options...
dreamwest Posted January 21, 2009 Share Posted January 21, 2009 cool.. Link to comment https://forums.phpfreaks.com/topic/141722-solved-what-is-this/#findComment-741913 Share on other sites More sharing options...
jkewlo Posted January 21, 2009 Share Posted January 21, 2009 I still dont get it Link to comment https://forums.phpfreaks.com/topic/141722-solved-what-is-this/#findComment-741914 Share on other sites More sharing options...
tqla Posted January 21, 2009 Author Share Posted January 21, 2009 Thanks zanus! Link to comment https://forums.phpfreaks.com/topic/141722-solved-what-is-this/#findComment-741916 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.