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


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

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

        $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>";


this line

while ($loopCond = false)

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


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