forFull code fragment that performs
REPEATED ACTIONS until a desired result is reached.
Performs
ITERATION of a variable executed in
THREE PARAMETERIZED PHASES:
1 . Assigning an
INITIAL VALUE to the variable.
2 . Establishment of the
ITERATIVE CALCULATION that will be submitted to the variable.
3 . Completion of the
ITERATIVE calculation.
Behavior for loops are the most complex loops in PHP.
This function works as its analog in C language.
<?php
// STRUCTURE #1
for ( expr1; expr2; expr3)
statement
where,
expr1 = first expression to be evaluated once unconditionally
at the beginning of the loop
expr2 = second expression, related to expr1
expr3 = third expression - the end of each iteration
?>
<?php
// STRUCTURE #2
for ( expr1; expr2; expr3)
{
statement
}
where,
expr1 = first expression to be evaluated once unconditionally
at the beginning of the loop
expr2 = second expression, related to expr1
expr3 = third expression - the end of each iteration
?>