forked from assembler-institute/php-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconditionals.php
More file actions
47 lines (44 loc) · 1.07 KB
/
conditionals.php
File metadata and controls
47 lines (44 loc) · 1.07 KB
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
<?php
$isMonday = date("D");
if ($isMonday == "Mon") {
echo "We are on Monday";
}
$currentMonth = date("M");
if ($currentMonth == "Oct") {
echo "We are on October";
} else {
echo "No, we are on $currentMonth";
}
$currentMinutes = date("i");
if ($currentMinutes < 10) {
echo "The current minute is less than 10";
} else if ($currentMinutes > 15) {
echo "The current minute is more than 15";
} else {
echo "does not meet any conditions";
}
$currentWeekDay = date("N");
switch ($currentWeekDay) {
case 1:
echo "It is Monday";
break;
case 2:
echo "It is Tuesday";
break;
case 3:
echo "It is Wednesday";
break;
case 4:
echo "It is Thursday";
break;
case 5:
echo "It is Friday";
break;
case 6:
echo "It is Saturday";
break;
case 7:
echo "It is Sunday";
break;
}
?>