Php problem with a lesson


hi, i'am stuck there:

My code doesn't looks like having any problem :confused: , i'am stuck there for hours, the auto correct say there is a " ; " but can't see/understand where i should put one more

<!DOCTYPE html>
		<title>Une boucle do-while</title>
		$condition = false;
		do {
	echo "<p>La boucle est exécutée une fois alors que la condition est fausse.</p>";
		} while ($condition);
	echo "<p>Maintenant on est sorti de la boucle.</p>";


Try this inside your loop:

echo "<p>La boucle est exécutée; une fois alors que la condition est fausse.</p>";

Notice the semi-colon in the sentence? Not sure this is the real fix but it worked for me.


Well, it worked, thanks.

But that doesn't make sens right ? :confused:


No it doesn't. The SCT is not a exhaustive test and may exhibit some anomalous behavior from time to time. I'm not well enough versed to investigate any further into this one.

While you are working on loops, I would recommend that you disable the auto-refresh before starting each lesson. That way you can take your time typing in the code.

<?php else ?>

at the top of your code (anywhere, actually) will raise a parse error and shutdown execution. Another option is to decrease the window size until the preview window disappears, which will do effectively the same thing, shut down the auto-refresh. Remember to remove that bit of code when ready to submit.


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