freeCodeCamp/guide/chinese/php/while/index.md

424 B

title localeTitle
While Loop 而Loop

循环时

只要满足循环条件, while循环就会while循环内执行语句。

句法:

$x = 0; 
 while ($x < 11) { 
    statement1; 
    $x++; 
 } 

**注意:**块代码必须具有更改或增加条件的语句。否则可能导致无限循环。

更多信息:

PHP While循环