SQL PHP HTML ASP JavaScript articles and free scripts to download
PHP Math

PHP Math functions for addition, subtraction, multipication & division

Simple PHP functions to handle addition , subtraction , multiplications and divisions can be done by using built in functions.

Best way to learn is to develop some sample scripts.

Here are some of them.

Let us start with simple addition of two variables storing numbers.
$a=5;
$b=6;
$c=$a+$b;
echo $c;
Now try a subtraction.
$a=8;
$b=10;
$c=$a-$b;
echo $c;

Multiplication

$a=3;
$b=14;
$c=$a*$b;
echo $c;

Division

$a=3;
$b=14;
$c=$a/$b;
echo $c;
The output of division can be formatted to required decimal places

Be the first to post comment on this article :


Google+

Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer