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

While Loops in PHP Forum

View Course » View Exercise

84 points
B55ce9ff69b923cbd393b70279afa1cf?s=140&d=retro
Submitted by
Dnyarko
almost 3 years ago

Oops, try again. Did you put parentheses around $LoopCond?

<!DOCTYPE html>


Much a do-while


<?php
$loopCond = false;
do {
echo "The loop ran even though the loop condition is false.";
} while ($loopCond > 0);

    echo "<p>Now the loop is done running.</p>";
?>
</body>

3 votes

permalink

<?php
    $loopCond = false;
    do {
        echo "<p>The loop ran even though the loop condition is false.</p>";
    } while ($loopCond);
        echo "<p>Now the loop is done running.</p>";
?>

829 points
55b11978d3292f1266000022_488087085
Submitted by
Kirill
almost 3 years ago

2 Comments

531984708c3e1bb7911eb31eeaf2808c?s=140&d=retro swapnil19 over 2 years ago

thanks kirill, it worked!!!

55b11978d3292f1266000022_488087085 Kirill over 2 years ago

You are welcome)