emorr1981 Posted March 11, 2007 Share Posted March 11, 2007 Hi there, What's the codes for basic math functions, like +, - , / , * , % Thanks :-) 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 +, - , / , * , % 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 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" 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. Link to comment https://forums.phpfreaks.com/topic/42231-basic-math-functions/#findComment-204871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.