Do While loop, I can't find any mistake in code


#1

Code looks as good, I can't find any mistake


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


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


#2

this line

while ($loopCond = false)

we use = for assigment if we want to compare two value then we shoud use == or ===


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.