• Teach Your Self With
             w3htmlschool.com

PHP for loop

PHP for loop run the code specified number of times.

Example
Example Output

Syntax


for(initialization; condition; increment)
{
// Code to be executed
}

Parameter


NameDescriptionRequired /Optional
ParameterInitialize the loop counter value
ConditionIf it condition evaluates to TRUE, the loop continues. If it condition evaluates to FALSE, the loop ends.Required
incrementIncrement or Decrements the variable