Where do i go wrong?


#1

here is the syntax. code is running on the screen but give me the error Did you put parentheses around $LoopCond?






<?php
$loopCond = false;
do {
echo "

The loop ran even though the loop condition is false.

";
}
while ( $loopCond== true);
		echo "<p>Now the loop is done running.</p>";

?>
</body>


#2

@skhanal1,
The specialty about a DO WHILE
is that the associated { code-block }
is executed at least once......
BEFORE
the WHILE-condition is checked.......

If you do not want that behaviour you could use WHILE-loop
where the WHILE-condition is checked
BEFORE
the associated { code-block }
is executed

http://stackoverflow.com/questions/224059/test-loops-at-the-top-or-bottom-while-vs-do-while