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
44 lines (35 loc) · 755 Bytes
/
Copy pathconditionals.php
File metadata and controls
44 lines (35 loc) · 755 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
<?php
$date = date("w");
if ($date == 1 ) {
echo "We are on Monday";
}
$dateMonth = new dateTime("NOW");
if ($dateMonth -> format("M") == "Oct"){
echo "We are in October";
}else {
print $dateMonth -> format("M")."<br>";
}
$minute = date("i");
if ($minute < 10 ){
echo "The current minute is less than 10"."<br>";
}else if ($minute > 15 ){
echo "the current minute is more than 15"."<br>";
}else{
echo "does not meet any conditions"."<br>";
}
$dayWeek = date("w");
switch ($dayWeek) {
case 0:
echo "Monday"."<br>";
break;
case 1:
echo "Tuesday"."<br>";
break;
case 2:
echo "Wednesday"."<br>";
break;
case 3:
echo "Thursday"."<br>";
break;
}
?>