{"id":74237,"date":"2025-02-06T02:57:51","date_gmt":"2025-02-05T18:57:51","guid":{"rendered":"https:\/\/0592ban.cn\/?p=74237"},"modified":"2025-02-06T02:57:51","modified_gmt":"2025-02-05T18:57:51","slug":"1979-%e5%b9%b4%e8%85%8a%e6%9c%88%e5%8d%81%e4%b9%9d%e6%97%a5%e6%98%af%e9%98%b3%e5%8e%86%e5%87%a0%e6%9c%88%e5%87%a0%e5%8f%b7-1979%e5%b9%b4%e8%85%8a%e5%85%ab%e8%8a%82%e6%98%af%e5%87%a0%e6%9c%88%e5%87%a0","status":"publish","type":"post","link":"https:\/\/0592ban.cn\/index.php\/2025\/02\/06\/1979-%e5%b9%b4%e8%85%8a%e6%9c%88%e5%8d%81%e4%b9%9d%e6%97%a5%e6%98%af%e9%98%b3%e5%8e%86%e5%87%a0%e6%9c%88%e5%87%a0%e5%8f%b7-1979%e5%b9%b4%e8%85%8a%e5%85%ab%e8%8a%82%e6%98%af%e5%87%a0%e6%9c%88%e5%87%a0\/","title":{"rendered":"1979 \u5e74\u814a\u6708\u5341\u4e5d\u65e5\u662f\u9633\u5386\u51e0\u6708\u51e0\u53f7 (1979\u5e74\u814a\u516b\u8282\u662f\u51e0\u6708\u51e0\u53f7)"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"1979\" loading=\"lazy\" src=\"https:\/\/0592ban.cn\/wp-content\/uploads\/2025\/02\/4848dea9-f7fd-4904-a961-621da31a154a.jpg\"\/><\/p>\n<form action=\"\" method=\"post\">\n <label for=\"date\"><br \/>\n  \u8bf7\u8f93\u5165\u9633\u5386\u65e5\u671f\uff1a<br \/>\n <\/label><br \/>\n <input id=\"date\" name=\"date\" type=\"date\"\/><br \/>\n <input type=\"submit\" value=\"\u67e5\u8be2\"\/><br \/>\n<\/form>\n<p><!--?php\n  \/\/ \u83b7\u53d6\u63d0\u4ea4\u7684\u65e5\u671f\n  $date = $_POST['date'];\n\n  \/\/ \u5c06\u9633\u5386\u65e5\u671f\u8f6c\u6362\u4e3a\u519c\u5386\u65e5\u671f\n  $lunarDate = solar_to_lunar($date);\n\n  \/\/ \u8f93\u51fa\u519c\u5386\u65e5\u671f\n  echo \"<p-->\n\u519c\u5386\uff1a{$lunarDate[&#8216;lunar_date&#8217;]}<br \/>\n&#8220;;<\/p>\n<p>  \/\/ \u8f93\u51fa\u751f\u8096<br \/>\n  $shengxiao = get_shengxiao($lunarDate[&#8216;lunar_year&#8217;]);<br \/>\n  echo &#8221;<\/p>\n<p>\n year&#8217; =&gt; $lunarYear,<br \/>\n      &#8216;lunar_month&#8217; =&gt; $lunarMonth,<br \/>\n      &#8216;lunar_day&#8217; =&gt; $lunarDay,<br \/>\n    ];<br \/>\n  }<\/p>\n<p>  \/<br \/>\n    \u83b7\u53d6\u751f\u8096<\/p>\n<p>    @param int $lunarYear \u519c\u5386\u5e74<\/p>\n<p>    @return string \u751f\u8096<br \/>\n   \/<br \/>\n  function get_shengxiao($lunarYear)<br \/>\n  {<br \/>\n    $shengxiao = [&#8216;\u9f20&#8217;, &#8216;\u725b&#8217;, &#8216;\u864e&#8217;, &#8216;\u5154&#8217;, &#8216;\u9f99&#8217;, &#8216;\u86c7&#8217;, &#8216;\u9a6c&#8217;, &#8216;\u7f8a&#8217;, &#8216;\u7334&#8217;, &#8216;\u9e21&#8217;, &#8216;\u72d7&#8217;, &#8216;\u732a&#8217;];<\/p>\n<p>    \/\/ \u8ba1\u7b97\u751f\u8096\u7d22\u5f15<br \/>\n    $index = ($lunarYear &#8211; 4) % 12;<\/p>\n<p>    \/\/ \u8fd4\u56de\u751f\u8096<br \/>\n    return $shengxiao[$index];<br \/>\n  }<\/p>\n<p>  \/<br \/>\n    \u83b7\u53d6\u661f\u5ea7<\/p>\n<p>    @param string $date \u65e5\u671f<\/p>\n<p>    @return string \u661f\u5ea7<br \/>\n   \/<br \/>\n  function get_constellation($date)<br \/>\n  {<br \/>\n    \/\/ \u83b7\u53d6\u661f\u5ea7\u8303\u56f4<br \/>\n    $constellations = [<br \/>\n      &#8216;\u767d\u7f8a\u5ea7&#8217; =&gt; [&#8217;03-21&#8242;, &#8217;04-19&#8242;],<br \/>\n      &#8216;\u91d1\u725b\u5ea7&#8217; =&gt; [&#8217;04-20&#8242;, &#8217;05-20&#8242;],<br \/>\n      &#8216;\u53cc\u5b50\u5ea7&#8217; =&gt; [&#8217;05-21&#8242;, &#8217;06-20&#8242;],<br \/>\n      &#8216;\u5de8\u87f9\u5ea7&#8217; =&gt; [&#8217;06-21&#8242;, &#8217;07-22&#8242;],<br \/>\n      &#8216;\u72ee\u5b50\u5ea7&#8217; =&gt; [&#8217;07-23&#8242;, &#8217;08-22&#8242;],<br \/>\n      &#8216;\u5904\u5973\u5ea7&#8217; =&gt; [&#8217;08-23&#8242;, &#8217;09-22&#8242;],<br \/>\n      &#8216;\u5929\u79e4\u5ea7&#8217; =&gt; [&#8217;09-23&#8242;, &#8217;10-22&#8242;],<br \/>\n      &#8216;\u5929\u874e\u5ea7&#8217; =&gt; [&#8217;10-23&#8242;, &#8217;11-21&#8242;],<br \/>\n      &#8216;\u5c04\u624b\u5ea7&#8217; =&gt; [&#8217;11-22&#8242;, &#8217;12-21&#8242;],<br \/>\n      &#8216;\u6469\u7faf\u5ea7&#8217; =&gt; [&#8217;12-22&#8242;, &#8217;01-19&#8242;],<br \/>\n      &#8216;\u6c34\u74f6\u5ea7&#8217; =&gt; [&#8217;01-20&#8242;, &#8217;02-18&#8242;],<br \/>\n      &#8216;\u53cc\u9c7c\u5ea7&#8217; =&gt; [&#8217;02-19&#8242;, &#8217;03-20&#8242;],<br \/>\n    ];<\/p>\n<p>    \/\/ \u83b7\u53d6\u6708\u4efd\u548c\u5929\u6570$date);<\/p>\n<p>    \/\/ \u5faa\u73af\u661f\u5ea7\u8303\u56f4<br \/>\n    foreach ($constellations as $constellation =&gt; $range) {<br \/>\n      list($startMonth, $startDay) = explode(&#8216;-&#8216;, $range[0]);<br \/>\n      list($endMonth, $endDay) = explode(&#8216;-&#8216;, $range[1]);<\/p>\n<p>      \/\/ \u5224\u65ad\u65e5\u671f\u662f\u5426\u5728\u661f\u5ea7\u8303\u56f4\u5185<br \/>\n      if (($month == $startMonth &amp;&amp; $day &gt;= $startDay) || ($month == $endMonth &amp;&amp; $day &lt;= $endDay)) {<br \/>\n        return $constellation;<br \/>\n      }<br \/>\n    }<\/p>\n<p>    \/\/ \u5982\u679c\u65e5\u671f\u4e0d\u5728\u4efb\u4f55\u661f\u5ea7\u8303\u56f4\u5185\uff0c\u5219\u8fd4\u56de\u7a7a\u5b57\u7b26\u4e32<br \/>\n    return &#8221;;<br \/>\n  }<\/p>\n<p>  \/<br \/>\n    \u83b7\u53d6\u5e72\u652f<\/p>\n<p>    @param int $lunarYear \u519c\u5386\u5e74<br \/>\n    @param int $lunarMonth \u519c\u5386\u6708<br \/>\n    @param int $lunarDay \u519c\u5386\u65e5<\/p>\n<p>    @return string \u5e72\u652f<br \/>\n   \/<br \/>\n  function get_ganzhi($lunarYear, $lunarMonth, $lunarDay)<br \/>\n  {<br \/>\n    \/\/ \u5929\u5e72<br \/>\n    $tiangan = [&#8216;\u7532&#8217;, &#8216;\u4e59&#8217;, &#8216;\u4e19&#8217;, &#8216;\u4e01&#8217;, &#8216;\u620a&#8217;, &#8216;\u5df1&#8217;, &#8216;\u5e9a&#8217;, &#8216;\u8f9b&#8217;, &#8216;\u58ec&#8217;, &#8216;\u7678&#8217;];<\/p>\n<p>    \/\/ \u5730\u652f<br \/>\n    $dizhi = [&#8216;\u5b50&#8217;, &#8216;\u4e11&#8217;, &#8216;\u5bc5&#8217;, &#8216;\u536f&#8217;, &#8216;\u8fb0&#8217;, &#8216;\u5df3&#8217;, &#8216;\u5348&#8217;, &#8216;\u672a&#8217;, &#8216;\u7533&#8217;, &#8216;\u9149&#8217;, &#8216;\u620c&#8217;, &#8216;\u4ea5&#8217;];<\/p>\n<p>    \/\/ \u8ba1\u7b97\u5929\u5e72\u7d22\u5f15<br \/>\n    $tianganIndex = ($lunarYear &#8211; 4) % 10;<\/p>\n<p>    \/\/ \u8ba1\u7b97\u5730\u652f\u7d22\u5f15<br \/>\n    $dizhiIndex = ($lunarMonth &#8211; 1) % 12;<\/p>\n<p>    \/\/ \u8fd4\u56de\u5e72\u652f<br \/>\n    return $tiangan[$tianganIndex] . $dizhi[$dizhiIndex];<br \/>\n  }<br \/>\n  ?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u8f93\u5165\u9633\u5386\u65e5\u671f\uff0c\u519c\u5386\uff0c$lunarDate[lunar\uff0cdate]\uff0c\u8f93\u51fa\u751f\u8096$shengxiao=get\uff0cshengxiao\uff0c$lunarDate[lunar\uff0cyear]\uff0cechoyear=&#038;gt\uff0c$lunarYear\uff0clunar\uff0cmonth=&#038;gt\uff0c$lunarMonth\uff0clunar\uff0cday=&#038;gt\uff0c$lunarDay\uff0c]&#8230;\u3002<\/p>\n","protected":false},"author":1,"featured_media":74236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9777,32734],"class_list":["post-74237","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12shengxiao","tag-9777","tag-32734"],"_links":{"self":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/74237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/comments?post=74237"}],"version-history":[{"count":1,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/74237\/revisions"}],"predecessor-version":[{"id":74238,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/74237\/revisions\/74238"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media\/74236"}],"wp:attachment":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media?parent=74237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/categories?post=74237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/tags?post=74237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}