While loop alternate syntax not recognized


#1



https://www.codecademy.com/courses/web-beginner-en-5YvPF/0/4


The interpreter is saying that I am not using the endwhile syntax, which is the requirement for the lesson.
Also, as an overall thing in the PHP course, as I am editing my code I create an infinite loop, which bugs the page out as the page interprets it immediately instead of waiting for me to finish my editing


<!DOCTYPE html>
<html>
    <head>
		<title>A loop of your own</title>
        <link type='text/css' rel='stylesheet' href='style.css'/>
	</head>
	<body>
    <?php
	//Add while loop below
    $headCount = 0;
    $flipCount = 0;
    while ($headCount < 5):
        $side = rand(0,1);
        $flipCount ++ ;
        if ($side == 1) {
            echo "<div class=coin>H</div>";
            $headCount ++;
        } else {
            echo "<div class=coin>T</div>";
            $headCount = 0;
        }
    endwhile;
    ?>
    </body>
</html>


#2

This is my code.

<?php
	//Add while loop below
    while(true):
        echo 'This will run only once';
        break;
    endwhile;
?>

Instructions clearly say that you need to "convert your while loop from last exercise to "endwhile" syntax". Did you do that? How did your loop look in past exercise? I don't know if they compare it, but if they do, maybe you didn't convert loop from previous exercise? Otherwise, your code seems ok.