Opérations mathématiques avec les nombres en PHP
Addition :
<?php
$a = 1 + 2;
echo $a; // affichera 3
?>
Soustraction :
<?php
$b = 3 - 2;
echo $b; // affichera 1
?>
Multiplication :
<?php
$c = 3 * 2;
echo $c; // affichera 6
?>
Division :
<?php
$d = 4 / 2;
echo $d; // affichera 2
?>
Créez une variable $a. Enregistrez-y
la somme des nombres 1, 2 et 3.
À l'aide de la commande echo, affichez
le contenu de la variable $a.