For loop format : for loop « Statement « PHP

For loop format

for ($x = 1, $y = 1, $z = 1;   //initial expressions
     $y < 10, $z < 10;         // termination checks
     $x = $x + 1, $y = $y + 2, // loop-end expressions
     $z = $z + 3){
  print("$x, $y, $z<BR>");


Related examples in the same category

1.For statement without second condition
2.For statement without all three statements
3.For loop: Counting Backwards
4.For loop: Counting By Fives
5.Use for loop to output HTML table
6.If statement inside a for loop
7.Nesting Two for Loops
8.A for Loop That Divides 4000 by Ten Incremental Numbers
9.Using the for Statement
10.A division table
11.A for Loop That Divides 4000 by Ten Incremental Numbers
12.A for loop in PHP
13.Alternating table row colors with for()
14.Loops Within Loops
15.Iterating through a multidimensional array with for()
16.Iterating through a numeric array with for()
17.Loop goes from 0 to 100 in steps of 0.1
18.Fahrenheit and Celsius table by for loop
19.Specifying a number after break, such as break 2, to break out of two loops or switch/case statements
20.Multiple expressions in for()
21.Nesting Two for Loops
22.Printing a
23.Printing out all the web-safe color codes