The While Loop

The while loop

Another type of loop is WHILE loop. It is used in situations where it is necessary to perform an operation until the condition.
Example

<? php

while (condition) {

instructions

}

?>
Example

<? php

$a = 1;
while ($a <= 10) {
echo $a. „<BR>”;
$a++;
}

?>

Cookies help us deliver our services. By using our services, you agree to our use of cookies. More Info | Close