This forum is now read-only. Please use our new forums at

For Loops in PHP Forum

View Course » View Exercise

27 points
Submitted by
Patrick Kelly
about 5 years ago

answer to loop question 2

i have played with fors i have added i++ i have done this that and other,i am lost.<?php
// Echoes the first five even numbers
for__ ($i = 0; $i < 11; $i = $i + 2) i++___
echo $i;

0 votes


You simply need to replace the underscores with the proper for-loop syntax:

for (expression 1; expression 2; expression 3) {
    // code to be executed

1912 points
Submitted by
almost 5 years ago