<!DOCTYPE html>
<html>
 <head>
     <meta charset="UTF-8" />
     <meta name="author" content="Manuele" />
    <title> Boucle for</title>
    <style>
        div { border: 1px solid black;
              padding: 3px; }
        p { color: blue; }
    </style>
 </head>
<body>
<div>
   <p>Exemple boucle for </p>
   
   <?php 
       
for ( $i $i <= $i++) 
       { 
           echo 
"<h$i> Titre niveau $i </h$i>";
       }
   
?>  
</div>

<div>
   <p>Exemple boucle while </p>
   
    <?php  
        $i 
;
        while ( 
$i <= ) {
           echo 
"<h$i> Titre niveau $i </h$i>";
           
$i $i 1;
        }
   
?>
   
</div>


<div>
   <p>Exemple boucle foreach </p>
   
    <?php  
        $tableau 
= array("h1""h2""h3""h4""h5""h6");
        foreach (
$tableau as $titre ) {
           echo 
"<$titre> Titre $titre </$titre>";
        }
   
?>
   
</div>

</body>
 </html>