Having trouble with the PHP Side Panel


Hi there folks:

I'm having trouble with the side pannel, it keeps loading when I'm done with the exercise.


This is the code I made:

<!DOCTYPE html>
		<title>Much a do-while</title>
		$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>";


The variable is set to false on purpose, so the loop only executes one iteration. We would never write == false.

while ($loopCond);

That's it. Since the variable is set to false the loop will terminate. If it was set to true and the loop body made no change, it would be an infinite loop. Take care when writing loops. Do some logic review is you are not comfortable with basic logic and control flow.


Then please reset the exercise for me, it is impossible now to get out of the loop since the wrong code was saved.


Make the window small enough for the preview window to disappear, then click Reset or fix the loop code and enlarge the window again. (Alternatively, zoom up for same effect.)


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