← CodePrimer
PHP Beginner Basics

PHP arithmetic operators

What are PHP math operators?

+ - * / % **.

Sample
<?php
$a = 10;
$b = 3;
echo $a + $b;
echo $a - $b;
echo $a * $b;
echo $a / $b;
echo $a % $b;
echo $a ** $b;

Notes

% is remainder; ** is exponentiation.

Keywords: operators · arithmetic · modulo

Related

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share