This forum is now read-only. Please use our new forums at

While Loops in PHP Forum

View Course » View Exercise

620 points
Submitted by
Tarun Jaluthria
almost 3 years ago

Not working on my google chrome...when i copy-paste these code to sublime text...

<!DOCTYPE html>

More Coin Flips

We will keep flipping a coin as long as the result is heads!
$flipCount = 0;
do {
$flip = rand(0,1);
$flipCount ++;
if ($flip){
echo "H";
else {
echo "T";
} while ($flip);
$verb = "were";
$last = "flips";
if ($flipCount == 1) {
$verb = "was";
$last = "flip";
echo "There {$verb} {$flipCount} {$last}!";

.coin {
height: 50px;
width: 50px;
border-radius: 25px;
background-color: grey;
text-align: center;
font-weight: bold;
font-family: sans-serif;
color: white;
margin: 10px;
display: inline-block;
line-height: 50px;
font-size: 20px;

not working on my sublime text as well as in google chrome...

0 votes


Mostly works in mozila firefox.

225 points
Submitted by
almost 3 years ago