Did you put parentheses around $LoopCond?


#1
To anyone who can help,

I'm having a little bit of an issue with a (do/while) lesson,

The example below outputs the the string however when I try to submit it, it responds with the message Oops, try again. Did you put parentheses around $LoopCond?,

I've already inserted the parenthesis?


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

?>
</body>

Any help on this would be hugely appreciated.


#2

@smiij92,
The DO-WHILE
will execute its code-block at least once
and then it will check the condition.

If you do not want that
you could use the WHILE-loop
where the condition is checked first, before eventually executing the WHILE-code-block