jbrill Posted July 9, 2007 Share Posted July 9, 2007 so lets say i have $a (a number) and $b(another number) to add them i do this: $c = ($a+$b) then echo $c but what do i do when it comes to multiplying those two variables? Link to comment https://forums.phpfreaks.com/topic/59175-solved-multiplying-numbers-in-php/ Share on other sites More sharing options...
Caesar Posted July 9, 2007 Share Posted July 9, 2007 <?php $x = ($a * $b) +2; ?> You mean, like that? Link to comment https://forums.phpfreaks.com/topic/59175-solved-multiplying-numbers-in-php/#findComment-293941 Share on other sites More sharing options...
jbrill Posted July 9, 2007 Author Share Posted July 9, 2007 what does the +2 do? Link to comment https://forums.phpfreaks.com/topic/59175-solved-multiplying-numbers-in-php/#findComment-293944 Share on other sites More sharing options...
teng84 Posted July 9, 2007 Share Posted July 9, 2007 <?php $x = ($a * $b) +2; ?> You mean, like that? $x = ($a * $b); the question is not clear Link to comment https://forums.phpfreaks.com/topic/59175-solved-multiplying-numbers-in-php/#findComment-293947 Share on other sites More sharing options...
Caesar Posted July 9, 2007 Share Posted July 9, 2007 what does the +2 do? Just showing you that you can add, multiply...pretty much anything you would do with numbers....just using variables. Link to comment https://forums.phpfreaks.com/topic/59175-solved-multiplying-numbers-in-php/#findComment-293951 Share on other sites More sharing options...
jbrill Posted July 9, 2007 Author Share Posted July 9, 2007 thanks alot guys Link to comment https://forums.phpfreaks.com/topic/59175-solved-multiplying-numbers-in-php/#findComment-293952 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.