December 2012
Intermediate to advanced
888 pages
48h 24m
English
The for construct performs a statement (block of code) for a set of conditions defined as follows:
for (start condition; end condition; increment function) { statement(s)}
The start condition is set at the beginning of the loop. Each time the loop is executed, the increment function is performed until the end condition is achieved. This looks much like the traditional for/next loop. The following code is an example of a for loop:
for ($i=1; $i<=10; $i++) { print "$i\n"}
Read now
Unlock full access