-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch.php
More file actions
59 lines (52 loc) · 988 Bytes
/
switch.php
File metadata and controls
59 lines (52 loc) · 988 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/*
* Copyright (C) 2024-2026 Katarzyna Krasińska
* PHP.lab - https://github.com/katheroine/php.lab
* Licensed under GPL-3.0 - see LICENSE.md
*/
$now = "afternoon";
switch ($now) {
case "morning":
print("Good morning!\n");
break;
case "afternoon":
print("Good afternoon!\n");
break;
case "evening":
print("Good evening!\n");
break;
case "night":
print("Good evening!\n");
break;
}
$now = "evening";
switch ($now) {
case "morning":
print("Good morning!\n");
break;
case "afternoon":
print("Good afternoon!\n");
break;
case "evening":
case "night":
print("Good evening!\n");
break;
}
$now = "other";
switch ($now) {
case "morning":
print("Good morning!\n");
break;
case "afternoon":
print("Good afternoon!\n");
break;
case "evening":
print("Good evening!\n");
break;
case "night":
print("Good evening!\n");
break;
default:
print("Hello!\n");
break;
}