PHP For Loops

PHP for loop is used when the specified condition is predefined.

Syntax:

Example

Output

Print counting using for loop
1
2
3
4
5

PHP Nested For loop

PHP Nested for loop is used inside the loop that is called nested for loop.

Example:

Output

Print pyramid using Nested for loop
*
**
***
****
*****

Leave a Comment