Expected p:first-child text to be equal to The loop is running. but got The loop is running


#1

I am having the same issue, the code is this:

<!DOCTYPE html>
<html>
    <head>
		<title>Your First PHP while loop!</title>
	</head>
	<body>
    <?php
	$loopCond = true;
	while ($loopCond == true){
		//Echo your message that the loop is running below
		echo "<p> The loop is running.</p>";
		$loopCond = false;
	}
	echo "<p>And now it's done.</p>";
    ?>
    </body>
</html>

and the error that I get after clicking save & submit is this: Oops, try again. expected p:first-child text to be equal to The loop is running. but got The loop is running.

I already refreshed the page for a couple of times as I try this for a couple of days and it's still the same issue.


The while loop is correct! but i can't continue?
#2

Hi Doru,

You have included a space here:

<p> The loop is running.</p>

The error message is not doing a good job of telling you that but it is what is causing the problem.


#3

wow...... thank you so much for that. It seems that I need to pay a little more attention to my future codes. Many thankses :smiley:


#4

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