Because in this code the 0
is assigned to IF
and the 1
value is assigned to ELSE
?
<?php
$flipCount = 0;
do {
$flip = rand(0,1);
$flipCount++;
if ($flip){
echo "<div class=\"coin\">H</div>";
}
else {
echo "<div class=\"coin\">T</div>";
}
}
Considering the answers given, then the opposite is true:
IF = TRUE (1) and ELSE = FALSE (0)