Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
The switch statement
SUBMITTED BY:
henry1874w
DATE:
June 12, 2017, 4:11 p.m.
FORMAT:
Text only
SIZE:
436 Bytes
Raw
Download
Tweet
HITS:
278
Go to comments
Report
<!DOCTYPE html>
<html>
<body>
<?php
$favcolor = "red";
switch ($favcolor) {
case "red":
echo "Your favorite color is red!";
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 red, blue, nor green!";
}
?>
</body>
</html>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus