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:-

Ashwani Kumar
Latest posts by Ashwani Kumar (see all)
Tagged : / / / / /
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x