Code:
<!DOCTYPE html><html>
<body>
<center>
<h1>Switch Control Statement</h1>
<?php
$color = "white";
switch ($color) {
case "white":
echo "Your favorite color is white!";
break;
case "blue":
echo "Your favorite color is blue!";
break;
case "green":
echo "Your favorite color is green!";
break;
default:
echo "Your favorite color is neither white, blue, nor green!";
}
?>
</center>
</body>
</html>
No comments:
Post a Comment