★ wanayoo — archive 1999 http://www.php.net/manual/fr/control-structures.continue.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Les structures de contrôle
Quick Reference
Les structures de contrôle
English version of this pageGerman version of this pageJapanese version of this pageItalian version of this pageHungarian version of this page
* if
* else
* elseif
* Syntaxe alternative
* while
* do..while
* for
* foreach
* break
* continue
* switch
* require
* include
Manual: continue
View the source code for this pageSearch the site



Previous page
 break
 Updated
Sun, 06 Aug 2000
switch 
Next page


continue

L'instruction continue est utilisée dans une boucle afin d'éluder les instructions de l'itération courante afin de passer directement à l'itération suivante.

continue accepte un argument numérique optionnel qui vous indiquera combien de structures emboîtées ont été ignorées.


while (list ($cle, $valeur) = each ($arr)) {
   if (!($cle % 2)) { // évite les membres impairs
       continue;
   }
   fonction_quelconque($valeur);
}

$i = 0;
while ($i++ < 5) {
    echo "Dehors<br>\n";
    while (1) {
        echo "  Milieu<br>\n";
        while (1) {
             echo "  Intérieur<br>\n";
             continue 3;
        }
        echo "Ceci n'est jamais atteint.<br>\n";
    }
    echo "Ceci non plus.<br>\n";
}
     


User Contributed Notes: continue


dmacdo@moncourrier.com
04-Aug-2000 03:48
The break will get out of the loop, while the continue stay in the loop, it just gets to the next iteration, not doing the one it was suposed to. (as I understanded it...)


 About Notes


Previous page
 break
 Updated
Sun, 06 Aug 2000
switch 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.