
请输入有效的数字.
“;exit;}// Check if the date is validif (!checkdate($month, $day, $year)) {echo ”
请输入有效的日期.
“;exit;}// Get the list of auspicious days for the year$auspicious_days = get_auspicious_days($year);// Check if the input date is an auspicious dayif (!in_array($day, $auspicious_days)) {echo ”
您输入的日期不是一个吉日.
“;exit;}// Display the auspicious days for the yearecho ”
“.$year.”年吉日如下:
“;echo “”;echo “”;foreach ($auspicious_days as $day) {echo “”;}echo ”
| 月份 | 日期 |
|---|---|
| “.$month.” | “.$day.” |
“;// Get the list of auspicious days for the yearfunction get_auspicious_days($year) {$auspicious_days = array();// Get the Chinese zodiac for the year$zodiac = get_chinese_zodiac($year);// Get the lucky days for the Chinese zodiacswitch ($zodiac) {case “鼠”:$lucky_days = array(1, 4, 6, 11, 15, 20, 24, 29);break;case “牛”:$lucky_days = array(2, 7, 12, 17, 22, 26, 30);break;case “虎”:$lucky_days = array(3, 8, 13, 18, 23, 27);break;case “兔”:$lucky_days = array(4, 9, 14, 19, 24, 28);break;case “龙”:$lucky_days = array(5, 10, 15, 20, 25, 29);break;case “蛇”:$lucky_days = array(6, 11, 16, 21, 26, 30);break;case “马”:$lucky_days = array(7, 12, 17, 22, 27);break;case “羊”:$lucky_days = array(8, 13, 18, 23, 28);break;case “猴”:$lucky_days = array(9, 14, 19, 24, 29);break;case “鸡”:$lucky_days = array(10, 15, 20, 25, 30);break;case “狗”:$lucky_days = array(11, 16, 21, 26);break;case “猪”:$lucky_days = array(12, 17, 22, 27);break;}// Get the days of the year that are in the lucky days arrayfor ($i = 1; $i <= 31; $i++) {if (in_array($i, $lucky_days)) {$auspicious_days[] = $i;}}return $auspicious_days;}// Get the Chinese zodiac for the yearfunction get_chinese_zodiac($year) {$zodiac = array(“鼠”, “牛”, “虎”, “兔”, “龙”, “蛇”, “马”, “羊”, “猴”, “鸡”, “狗”, “猪”);return $zodiac[($year – 4) % 12];}?>
Midjourney









