2. While loop syntax


#1

Need help with this. Anyone. Pl help.

This is the error I'm receiving.
"Oops, try again. expected p:first-child text to be equal to The loop is running. but got The loop is running !"

https://www.codecademy.com/courses/web-beginner-en-5YvPF/0/2?curriculum_id=5124ef4c78d510dd89003eb8#


<!DOCTYPE html>
<html>
    <head>
		<title>Your First PHP while loop!</title>
	</head>
	<body>
    <?php
	$loopCond = true;
	$ran=2;
	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>


#2

Instruction:

Inside the curly braces, use echo to output "<p>The loop is running.</p>"

The string should be exact same even a single space.


#3

Oh. ■■■■. Got that. Thanks.


#4

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