While and Do-While Statements in PHP : Tutorial

When we want to repeat some set of statements we use loop statements. We may want to repeat the statement-block for certain number of times util a particular condition is met.

In PHP we have three kinds of looping statements available,
1. for loop statement.
2. while loop statement.
3. do-while loop statement.

While Loop Statements in PHP

While loop is used when we have to loop through a block of statements for a fixed number of times.