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. ??? ??? ??? Quote 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 Quote 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; Quote 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.. Quote 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 Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/141722-solved-what-is-this/#findComment-741916 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.