-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbirth.php
More file actions
34 lines (34 loc) · 908 Bytes
/
birth.php
File metadata and controls
34 lines (34 loc) · 908 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
<?php
$birth_month = 1;
$birth_day = 29;
$birth_year = 1995;
if (empty($birth_year) || empty($birth_month) || empty($birth_day)) {
die("birthday date is not complete.");
}
switch ($birth_month)
{
case 1: print "January "; break;
case 2: print "Februry "; break;
case 3: print "March "; break;
case 4: print "April "; break;
case 5: print "May "; break;
case 6: print "June "; break;
case 7: print "July "; break;
case 8: print "August "; break;
case 9: print "September "; break;
case 10: print "October "; break;
case 11: print "November "; break;
case 12: print "December "; break;
default: die("month is not valid!");
}
if (($birth_day < 1) || ($birth_day > 31)) {
die("date is wrong!");
} else {
echo $birth_day, " ";
}
if (($birth_year < 1990) || ($birth_year > 2005)) {
die("year is wrong!");
} else {
echo $birth_year;
}
?>