PHP 8 Beginner Basics · 1 min read

PHP arithmetic operators

Start the PHP 8 learning path »

❮ PHP 8 Home All Tutorials ❯

What are PHP math operators?

+ - * / % **.

Example

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

Line-by-Line Walkthrough

% is remainder; ** is exponentiation.

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…