-
Notifications
You must be signed in to change notification settings - Fork 0
/
ifElse.php
44 lines (36 loc) · 902 Bytes
/
ifElse.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
<!DOCTYPE html>
<html>
<body>
<h1>My First PHP page</h1>
<?php
$day = "wednesday";
switch($day) {
case "sunday" :
echo "Holiday<br>";
break;
case "saturday":
echo "Holiday<br>";
break;
default:
echo "Working day<br>";
}
$t = date("H");
if($t < "11") {
echo "Good morning!<br>";
} elseif ($t < "18") {
echo "Good Afternoon!<br>";
} else {
echo "Good night!<br>";
}
if($t > 20) {
echo "Good night<br>";
} else {
echo "Good day<br>";
}
if($t < 20) {
echo "Good Night<br>";
echo $t . "<br>";
}
?>
</body>
</html>