Files
freeCodeCamp/guide/english/php/while/index.md
2018-10-16 21:32:40 +05:30

482 B

title
title
While Loop

While Loops

A while loop executes statements within the loop as long as the loops condition is met.

Syntax:

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

Note: The block code must have a statement that changes or increments the condition. Otherwise an infinite loop could result.

More Information:

PHP While Loop