Operators
Operators carry out operations on variables and values.Arithmetic Operators
Arithmetic operators work with numeric values to perform common arithmetical operations.Example:
<?php
$num1 = 8;
$num2 = 6;
//Addition
echo $num1 + $num2; //14
//Subtraction
echo $num1 - $num2; //2
//Multiplication
echo $num1 * $num2; //48
//Division
echo $num1 / $num2; //1.33333333333
?>
$num1 = 8;
$num2 = 6;
//Addition
echo $num1 + $num2; //14
//Subtraction
echo $num1 - $num2; //2
//Multiplication
echo $num1 * $num2; //48
//Division
echo $num1 / $num2; //1.33333333333
?>
No comments:
Post a Comment