PHP while loop

If specified conditions are true then it executes that code.

while – As long conditions is true, it loop back again and again through block of code.

Syntax:
while (condition is true) {
code to be executed;
}

Example:

Result:

The number is: 11
The number is: 12
The number is: 13

Leave a Comment