This forum is now read-only. Please use our new forums! Go to forums
6/7 - Oops, try again. Did you put parentheses around $LoopCond?
I am getting the right answer for this problem but it will not let me move on to next page since it is error Oops, try again. 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>";
?>
Answer 553ca0979113cb4c1f000660
Answer 5536bead51b887bb5000019d
0 votes
you need the
brackets around “The loop ran even though the loop condition is false.”
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
3 comments
Why? Dosen’t $loopCond have to be true to stop the loop? I mean, it works and all but I don’t get it why.
Ok, so I gave a little thinking and I came up with this: The code will echo “The loop ran even though the loop condition is false.” until it hits $loopCond top be true. By having while($loopCond) it means $loopCond is equal to $loopCond which results a true action so “
Now the loop is done running.
“ will be echoed.But, if you change the $loopCond to a value, for ex. 3, it will stop working. I still don’t get it. Can you explain, pls?