PHP: Exemple des Variables Globales

Author:


Download

<html>
<head>
<title>Déclaration et appel des variables globales-Exemple</title>
</head>
<body>
<?php
$nombre_operation = 0;
function calcul( $a, $b )
{
    global $nombre_operation;

     $total= $a+$b;
    $nombre_operation++;
    print "Opération<h1> $nombre_operation:</h1> ($a + $b)=$total<br/>";
}
calcul(2,3);
calcul(12.32,85);
print("Fin des opérations");
 ?>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *


six + = 9