SirChick Posted October 2, 2007 Share Posted October 2, 2007 I been wondering which way is the correct way to code this .... i have 5 variables i need to add together then multiply by 5. So i got this: $Total = $StrengthInput + $DexterityInput + $DefenceInput + $AgilityInput * 5; Then i wondered would it be better to do this: $Total = $StrengthInput + $DexterityInput + $DefenceInput + $AgilityInput; $NewTotal = $Total * 5; Link to comment https://forums.phpfreaks.com/topic/71542-solved-multiply-a-number-of-variables/ Share on other sites More sharing options...
trq Posted October 2, 2007 Share Posted October 2, 2007 <?php $Total = ($StrengthInput + $DexterityInput + $DefenceInput + $AgilityInput) * 5; ?> Link to comment https://forums.phpfreaks.com/topic/71542-solved-multiply-a-number-of-variables/#findComment-360209 Share on other sites More sharing options...
SirChick Posted October 2, 2007 Author Share Posted October 2, 2007 Argh ok thankyou. Link to comment https://forums.phpfreaks.com/topic/71542-solved-multiply-a-number-of-variables/#findComment-360210 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.