for loop increment by 2

by Ramya 2012-07-03 10:40:25

for loop increment by 2:

you can increment for loop by 2,
for($h=3;$h<15;$h+=2){}


for example, if you want to display only odd numbers then you can increment the variable inside the for loop by 2,
for($h=3;$h<15;$h+=2){
echo $h."
";
}
957
like
0
dislike
0
mail
flag

You must LOGIN to add comments