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 Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/149863-this-multiplication/#findComment-787021 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.