23 lines
762 B
Markdown
23 lines
762 B
Markdown
---
|
||
title: While Loop
|
||
localeTitle: Пока цикл
|
||
---
|
||
## В то время как петли
|
||
|
||
В `while` цикл выполняется операторы внутри цикла до тех пор , пока условие удовлетворяется петли.
|
||
|
||
### Синтаксис:
|
||
|
||
```php
|
||
$x = 0;
|
||
while ($x < 11) {
|
||
statement1;
|
||
$x++;
|
||
}
|
||
```
|
||
|
||
**Примечание** . Блок-код должен иметь оператор, который изменяет или увеличивает условие. В противном случае может возникнуть бесконечный цикл.
|
||
|
||
### Дополнительная информация:
|
||
|
||
[PHP while Loop](http://php.net/manual/en/control-structures.while.php) |