Tutorial for while loop

What is while Loop?

As long as the (while) statement’s condition evaluates to true, the (while) assertion cycles around a block of code. They’re used to run a section of code repeatedly until the set condition is met. The while loop keeps repeating an action until an associated condition returns false.

PHP while statement - w3resource

Syntex:-

while (condition is true) {
  code to be executed;
}
PHP Loop and  Control Structures

Example1:-

Output:-

Example2:-

Output:-

Tagged : / / / / /