markstrange Posted March 17, 2009 Share Posted March 17, 2009 Hello, I want to be able to have the variable $qty multiplied with 2 and then use the new value later on in the php script. Can I do that with this line? $this->volume += ($qty * 2); Regards, Mark Link to comment https://forums.phpfreaks.com/topic/149863-this-multiplication/ Share on other sites More sharing options...
wildteen88 Posted March 17, 2009 Share Posted March 17, 2009 That will multiply $qty by 2 and then add it on to the current value of $this->volume For example, say $this->volume was set to 5 and $qty is set to 10, when the following is run $this->volume += ($qty * 2); $this->volume will equal 25 Link to comment https://forums.phpfreaks.com/topic/149863-this-multiplication/#findComment-787016 Share on other sites More sharing options...
markstrange Posted March 17, 2009 Author Share Posted March 17, 2009 Thank you for the quick and explanatory reply. Link to comment https://forums.phpfreaks.com/topic/149863-this-multiplication/#findComment-787021 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.