-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitch.php
55 lines (46 loc) · 1.02 KB
/
switch.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<body>
<h1>My first PHP page</h1>
<?php
$d = 3;
switch ($d) {
case 1:
case 2:
case 3:
case 4:
case 5:
echo "The weeks feels so long!";
break;
case 6:
case 0:
echo "Weekends are the best!";
break;
default:
echo "Something went wrong";
}
switch ($d) {
default:
echo "Looking forward to the Weekend";
break;
case 6:
echo "Today is Saturday";
break;
case 0:
echo "Today is Sunday";
}
$favcolor = "red";
switch ($favcolor) {
case "red":
echo "Your favorite color is red!";
case "blue":
"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>