PHP Looping

Sometimes we want a program to repeat something over and over again. A loop is used to make a program do something more than one time.

PHP loops execute a block of commands a specified number of times until a condition is met.

PHP supports following types of loops:

All are slightly different and provides loops for different situations.

Subscribe Updates via Email

Join 49,000+ W3schools lovers and get all the latest tutorials, programs, algorithms in your inbox.