-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch.php
More file actions
34 lines (26 loc) · 692 Bytes
/
switch.php
File metadata and controls
34 lines (26 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!doctype html>
<html>
<head>
<title>PHP Switches</title>
</head>
<body>
<h1>PHP Switches</h1>
<p>A switch is a very specific type of if statement. It can be used wen your decision is based on one variable and a list of options:</p>
<?php
$day = date('l');
echo '<p>Today is '.$day.'!</p>';
switch ($day)
{
case "Monday":
echo "Sounds like someone has a case of the Mondays!";
break;
case "Friday":
echo "TFIG!";
break;
default:
echo "Have a great day!";
break;
}
?>
</body>
</html>