FOR The for function is the more complex sibling of the while function and provides a more streamline and complex looping mechanism. The for function takes three expressions; the first expression is evaluated by default at the first iteration of the loop, the second expression is evaluated at the beginning of each iteration (and determines if the loop will continue) and the third expression is evaluated at the conclusion of each loop. Any of the expressions can be empty and the logic that would take place in the expression can be substituted in the body of the function itself. The statement list within the for code body can consist of one or more statements. for (expression1; expression2; expression3) { -- statements that execute while the expressions evaluates false } The following examples demonstrate how the for iterative control statement can work: <?php ...
“The best way to be ready for the future is to invent it.”— John Sculley