emorr1981 Posted March 11, 2007 Share Posted March 11, 2007 Hi there, What's the codes for basic math functions, like +, - , / , * , % Thanks :-) Quote Link to comment https://forums.phpfreaks.com/topic/42231-basic-math-functions/ Share on other sites More sharing options...
interpim Posted March 11, 2007 Share Posted March 11, 2007 +, - , / , * , % Quote Link to comment https://forums.phpfreaks.com/topic/42231-basic-math-functions/#findComment-204864 Share on other sites More sharing options...
legohead6 Posted March 11, 2007 Share Posted March 11, 2007 to make a varible you $variable=8-3; some will also put the math in brackets.. but its up to you Quote Link to comment https://forums.phpfreaks.com/topic/42231-basic-math-functions/#findComment-204865 Share on other sites More sharing options...
cmgmyr Posted March 11, 2007 Share Posted March 11, 2007 $add = 2 + 2; echo $add; // prints 4 $sub = 5 - 2; echo $sub; //prints 3 $mul = 3 * 2; echo $mul; // prints 6 $div = 4 / 2; echo $div; //prints 2 $mod = 2 % 1; echo $mod; // prints 0 ...hope this helps, you can find a LOT more online if you search for "php math functions" Quote Link to comment https://forums.phpfreaks.com/topic/42231-basic-math-functions/#findComment-204870 Share on other sites More sharing options...
legohead6 Posted March 11, 2007 Share Posted March 11, 2007 http://www.w3schools.com is also a good reference. Quote Link to comment https://forums.phpfreaks.com/topic/42231-basic-math-functions/#findComment-204871 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.