/[LeafOK_CVS]/fenglin/lib/astro.inc.php
ViewVC logotype

Annotation of /fenglin/lib/astro.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations)
Wed Apr 23 05:13:57 2025 UTC (10 months, 3 weeks ago) by sysadm
Branch: MAIN
Changes since 1.4: +1 -1 lines
Refine deprecated PHP short tags

1 sysadm 1.5 <?php
2 sysadm 1.4 function Date2Astro(int $month, int $day) : string
3     {
4     $dates = array(21, 20, 21, 21, 22, 22, 23, 24, 24, 24, 23, 22);
5     $astro = array("摩羯", "水瓶", "双鱼", "白羊", "金牛", "双子", "巨蟹", "狮子", "处女", "天秤", "天蝎", "射手", "摩羯");
6 sysadm 1.1
7 sysadm 1.2 if ($month < 1 || $month >12 || $day < 1 || $day > 31)
8 sysadm 1.4 {
9 sysadm 1.2 return $astro[0];
10 sysadm 1.4 }
11    
12     if ($day < $dates[$month - 1])
13     {
14     return $astro[$month - 1];
15     }
16    
17     return $astro[$month];
18 sysadm 1.1 }
19     ?>

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1