{"id":1890,"date":"2024-05-30T17:53:16","date_gmt":"2024-05-30T09:53:16","guid":{"rendered":"https:\/\/0592ban.cn\/?p=1890"},"modified":"2024-05-30T17:53:16","modified_gmt":"2024-05-30T09:53:16","slug":"90%e5%b9%b4%e5%86%9c%e5%8e%86%e5%90%8e%e4%ba%94%e6%9c%88%e5%87%ba%e7%94%9f-%e5%af%b9%e5%ba%94%e5%93%aa%e4%b8%aa%e6%98%9f%e5%ba%a7-90%e5%b9%b4%e5%86%9c%e5%8e%86%e5%90%8e%e4%ba%94%e6%9c%88%e7%9a%84","status":"publish","type":"post","link":"https:\/\/0592ban.cn\/index.php\/2024\/05\/30\/90%e5%b9%b4%e5%86%9c%e5%8e%86%e5%90%8e%e4%ba%94%e6%9c%88%e5%87%ba%e7%94%9f-%e5%af%b9%e5%ba%94%e5%93%aa%e4%b8%aa%e6%98%9f%e5%ba%a7-90%e5%b9%b4%e5%86%9c%e5%8e%86%e5%90%8e%e4%ba%94%e6%9c%88%e7%9a%84\/","title":{"rendered":"90\u5e74\u519c\u5386\u540e\u4e94\u6708\u51fa\u751f \u5bf9\u5e94\u54ea\u4e2a\u661f\u5ea7 (90\u5e74\u519c\u5386\u540e\u4e94\u6708\u7684\u9a6c\u662f\u4ec0\u4e48\u547d)"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"\u5bf9\u5e94\u54ea\u4e2a\u661f\u5ea7\" loading=\"lazy\" src=\"https:\/\/0592ban.cn\/wp-content\/uploads\/2024\/05\/b327104d-c51a-46e1-8300-092de5454827.jpg\"\/><\/p>\n<form action=\"index.php\" method=\"post\">\n <label for=\"birthdate\"><br \/>\n  \u51fa\u751f\u65e5\u671f\uff08\u9633\u5386\uff09\uff1a<br \/>\n <\/label><br \/>\n <input id=\"birthdate\" name=\"birthdate\" required=\"\" type=\"date\"\/><br \/>\n <input type=\"submit\" value=\"\u67e5\u8be2\"\/><br \/>\n<\/form>\n<p><!--?php\n  if (isset($_POST['birthdate'])) {\n    \/\/ \u83b7\u53d6\u51fa\u751f\u65e5\u671f\n    $birthdate = $_POST['birthdate'];\n\n    \/\/ \u8f6c\u6362\u9633\u5386\u4e3a\u519c\u5386\n    $lunarDate = new LunarDate($birthdate);\n    $lunarMonth = $lunarDate---><br \/>\ngetMonth();<br \/>\n    $lunarDay = $lunarDate-&gt;getDay();<\/p>\n<p>    \/\/ \u8ba1\u7b97\u9633\u5386\u5bf9\u5e94\u7684\u661f\u5ea7<br \/>\n    $zodiacSign = getZodiacSign($birthdate);<\/p>\n<p>    \/\/ \u8f93\u51fa\u67e5\u8be2\u7ed3\u679c<br \/>\n    echo &#8221;<\/p>\n<h2>\n \u67e5\u8be2\u7ed3\u679c\uff1a<br \/>\n<\/h2>\n<p>&#8220;;<br \/>\n    echo &#8220;&#8221;;<br \/>\n    echo &#8220;&#8221;;<br \/>\n    echo &#8220;&#8221;;<br \/>\n    echo &#8221;<\/p>\n<table>\n<tbody>\n<tr>\n<th>\n    \u9633\u5386\u65e5\u671f\n   <\/th>\n<th>\n    \u519c\u5386\u65e5\u671f\n   <\/th>\n<th>\n    \u661f\u5ea7\n   <\/th>\n<\/tr>\n<tr>\n<td>\n    $birthdate\n   <\/td>\n<td>\n    $lunarMonth \u6708 $lunarDay \u65e5\n   <\/td>\n<td>\n    $zodiacSign\n   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#8220;;<br \/>\n  }<\/p>\n<p>  \/\/ \u8ba1\u7b97\u9633\u5386\u5bf9\u5e94\u7684\u661f\u5ea7<br \/>\n  function getZodiacSign($birthdate) {<br \/>\n    $month = date(&#8216;n&#8217;, strtotime($birthdate));<br \/>\n    $day = date(&#8216;j&#8217;, strtotime($birthdate));<\/p>\n<p>    $zodiacSigns = array(<br \/>\n      array(&#8220;from&#8221; =&gt; 3, &#8220;to&#8221; =&gt; 20, &#8220;sign&#8221; =&gt; &#8220;\u767d\u7f8a\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 4, &#8220;to&#8221; =&gt; 20, &#8220;sign&#8221; =&gt; &#8220;\u91d1\u725b\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 5, &#8220;to&#8221; =&gt; 21, &#8220;sign&#8221; =&gt; &#8220;\u53cc\u5b50\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 6, &#8220;to&#8221; =&gt; 22, &#8220;sign&#8221; =&gt; &#8220;\u5de8\u87f9\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 7, &#8220;to&#8221; =&gt; 22, &#8220;sign&#8221; =&gt; &#8220;\u72ee\u5b50\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 8, &#8220;to&#8221; =&gt; 23, &#8220;sign&#8221; =&gt; &#8220;\u5904\u5973\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 9, &#8220;to&#8221; =&gt; 23, &#8220;sign&#8221; =&gt; &#8220;\u5929\u79e4\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 10, &#8220;to&#8221; =&gt; 23, &#8220;sign&#8221; =&gt; &#8220;\u5929\u874e\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 11, &#8220;to&#8221; =&gt; 22, &#8220;sign&#8221; =&gt; &#8220;\u5c04\u624b\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 12, &#8220;to&#8221; =&gt; 21, &#8220;sign&#8221; =&gt; &#8220;\u6469\u7faf\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 1, &#8220;to&#8221; =&gt; 20, &#8220;sign&#8221; =&gt; &#8220;\u6c34\u74f6\u5ea7&#8221;),<br \/>\n      array(&#8220;from&#8221; =&gt; 2, &#8220;to&#8221; =&gt; 19, &#8220;sign&#8221; =&gt; &#8220;\u53cc\u9c7c\u5ea7&#8221;)<br \/>\n    );<\/p>\n<p>    foreach ($zodiacSigns as $zodiacSign) {<br \/>\n      if ($month == $zodiacSign[&#8220;from&#8221;] &amp;&amp; $day &lt;= $zodiacSign[&#8220;to&#8221;]) {<br \/>\n        return $zodiacSign[&#8220;sign&#8221;];<br \/>\n      } else if ($month == $zodiacSign[&#8220;to&#8221;] &amp;&amp; $day &gt;= $zodiacSign[&#8220;from&#8221;]) {<br \/>\n        return $zodiacSign[&#8220;sign&#8221;];<br \/>\n      }<br \/>\n    }<br \/>\n  }<\/p>\n<p>  \/\/ \u519c\u5386\u65e5\u671f\u7c7b<br \/>\n  class LunarDate {<br \/>\n    private $year;<br \/>\n    private $month;<br \/>\n    private $day;<\/p>\n<p>    public function __construct($date) {<br \/>\n      $date = date(&#8216;Y-m-d&#8217;, strtotime($date));<br \/>\n      $lunarDate = new ChineseCalendar($date);<br \/>\n      $this-&gt;year = $lunarDate-&gt;getYear();<br \/>\n      $this-&gt;month = $lunarDate-&gt;getMonth();<br \/>\n      $this-&gt;day = $lunarDate-&gt;getDay();<br \/>\n    }<\/p>\n<p>    public function getYear() {<br \/>\n      return $this-&gt;year;<br \/>\n    }<\/p>\n<p>    public function getMonth() {<br \/>\n      return $this-&gt;month;<br \/>\n    }<\/p>\n<p>    public function getDay() {<br \/>\n      return $this-&gt;day;<br \/>\n    }<br \/>\n  }<br \/>\n  ?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u51fa\u751f\u65e5\u671f\uff0c\u9633\u5386\uff0cgetMonth\uff0c$lunarDay=$lunarDate\uff0c&#038;gt\uff0cgetDay\uff0c\u8ba1\u7b97\u9633\u5386\u5bf9\u5e94\u7684\u661f\u5ea7$zodiacSign=getZodiacSign\uff0c$birthdate\uff0c\u8f93\u51fa\u67e5\u8be2\u7ed3\u679cecho\u67e5\u8be2\u7ed3\u679c\uff0cecho\uff0cecho\uff0cecho\uff0cecho\u9633\u5386\u65e5\u671f\u519c\u5386\u65e5\u671f\u661f\u5ea7$birthdate$lunarMo&#8230;\u3002<\/p>\n","protected":false},"author":1,"featured_media":1889,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1162,1163],"class_list":["post-1890","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12shengxiao","tag-1162","tag-1163"],"_links":{"self":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/1890","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=1890"}],"version-history":[{"count":1,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/1890\/revisions"}],"predecessor-version":[{"id":1891,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/1890\/revisions\/1891"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media\/1889"}],"wp:attachment":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}