for loops are the most complex type of loop in PHP. They behave like for loops in C, Java, and JavaScript. It's basic form is:
for (expr1; expr2; expr3) {
// statements
}
The first expression (expr1) is evaluated before the loop starts. The second expression (expr2) is evaluated before each iteration, if it evaluates to a truthy value, the statements are executed. After the executed statements, the third expression (expr3) is evaluated.