{"id":63007,"date":"2025-01-15T03:44:27","date_gmt":"2025-01-14T19:44:27","guid":{"rendered":"https:\/\/0592ban.cn\/?p=63007"},"modified":"2025-01-15T03:44:27","modified_gmt":"2025-01-14T19:44:27","slug":"1978%e5%b9%b4%e5%86%9c%e5%8e%86%e8%85%8a%e6%9c%88%e4%ba%8c%e5%8d%81%e4%b8%89%e5%af%b9%e5%ba%94%e7%9a%84%e9%98%b3%e5%8e%86%e6%97%a5%e6%9c%9f-1978%e5%b9%b4%e5%86%9c%e5%8e%86","status":"publish","type":"post","link":"https:\/\/0592ban.cn\/index.php\/2025\/01\/15\/1978%e5%b9%b4%e5%86%9c%e5%8e%86%e8%85%8a%e6%9c%88%e4%ba%8c%e5%8d%81%e4%b8%89%e5%af%b9%e5%ba%94%e7%9a%84%e9%98%b3%e5%8e%86%e6%97%a5%e6%9c%9f-1978%e5%b9%b4%e5%86%9c%e5%8e%86\/","title":{"rendered":"1978\u5e74\u519c\u5386\u814a\u6708\u4e8c\u5341\u4e09\u5bf9\u5e94\u7684\u9633\u5386\u65e5\u671f (1978\u5e74\u519c\u5386)"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"1978\u5e74\u519c\u5386\" loading=\"lazy\" src=\"https:\/\/0592ban.cn\/wp-content\/uploads\/2025\/01\/87d0015e-820e-40ce-bff6-a74aa0971595.jpg\"\/><\/p>\n<form action=\"calculate.php\" method=\"post\">\n <label for=\"birth-date\"><br \/>\n  \u51fa\u751f\u65e5\u671f\uff08\u9634\u5386\uff09\uff1a<br \/>\n <\/label><br \/>\n <input id=\"birth-date\" name=\"birth-date\" placeholder=\"\u5982\uff1a1978-12-23\" type=\"text\"\/><br \/>\n <input type=\"submit\" value=\"\u67e5\u8be2\"\/><br \/>\n<\/form>\n<p>\n<!--?php\n  if (isset($_POST['birth-date'])) {\n    $birth_date = $_POST['birth-date'];\n    $parts = explode('-', $birth_date);\n    $year = $parts[0];\n    $month = $parts[1];\n    $day = $parts[2];\n    \n    $timestamp = mktime(0, 0, 0,$month, $day, $year);\n    $solar_date = date('Y-m-d', $timestamp);\n\n    $constellation = calculate_constellation($solar_date);\n\n    echo \"<p-->\n\u60a8\u7684\u51fa\u751f\u9633\u5386\u65e5\u671f\uff1a{$solar_date}<br \/>\n&#8220;;<br \/>\n    echo &#8221;<\/p>\n<p>\n \u60a8\u7684\u661f\u5ea7\uff1a{$constellation}\n<\/p>\n<p>&#8220;;<br \/>\n  }<\/p>\n<p>  function calculate_constellation($solar_date) {<br \/>\n    $month_day = explode(&#8216;-&#8216;, $solar_date)[1] . &#8216;-&#8216; . explode(&#8216;-&#8216;, $solar_date)[2];<\/p>\n<p>    $constellations = array(<br \/>\n      &#8217;01-20&#8217; =&gt; &#8216;\u6c34\u74f6\u5ea7&#8217;,<br \/>\n      &#8217;02-19&#8242; =&gt; &#8216;\u53cc\u9c7c\u5ea7&#8217;,<br \/>\n      &#8217;03-21&#8242; =&gt; &#8216;\u767d\u7f8a\u5ea7&#8217;,<br \/>\n      &#8217;04-20&#8242; =&gt; &#8216;\u91d1\u725b\u5ea7&#8217;,<br \/>\n      &#8217;05-21&#8242; =&gt; &#8216;\u53cc\u5b50\u5ea7&#8217;,<br \/>\n      &#8217;06-22&#8242; =&gt; &#8216;\u5de8\u87f9\u5ea7&#8217;,<br \/>\n      &#8217;07-23&#8242; =&gt; &#8216;\u72ee\u5b50\u5ea7&#8217;,<br \/>\n      &#8217;08-23&#8242; =&gt; &#8216;\u5904\u5973\u5ea7&#8217;,<br \/>\n      &#8217;09-23&#8242; =&gt; &#8216;\u5929\u79e4\u5ea7&#8217;,<br \/>\n      &#8217;10-24&#8242; =&gt; &#8216;\u5929\u874e\u5ea7&#8217;,<br \/>\n      &#8217;11-23&#8242; =&gt; &#8216;\u5c04\u624b\u5ea7&#8217;,<br \/>\n      &#8217;12-22&#8242; =&gt; &#8216;\u6469\u7faf\u5ea7&#8217;,<br \/>\n    );<\/p>\n<p>    foreach ($constellations as $date_range =&gt; $constellation) {<br \/>\n      if ($month_day &lt;= $date_range) {<br \/>\n        return $constellation;<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n  ?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u51fa\u751f\u65e5\u671f\uff0c\u9634\u5386\uff0c\u60a8\u7684\u51fa\u751f\u9633\u5386\u65e5\u671f\uff0c$solar\uff0cdate\uff0cecho\u60a8\u7684\u661f\u5ea7\uff0c$constellation\uff0cfunctioncalculate\uff0cconstellation\uff0c$solar\uff0cdate\uff0c$month\uff0cday=explode\uff0c$solar\uff0cdate\uff0c[1].\uff0c.explode\uff0c$solar\uff0cdate\uff0c[2]&#8230;\u3002<\/p>\n","protected":false},"author":1,"featured_media":63006,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27405],"class_list":["post-63007","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12shengxiao","tag-27405"],"_links":{"self":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/63007","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=63007"}],"version-history":[{"count":1,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/63007\/revisions"}],"predecessor-version":[{"id":63008,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/63007\/revisions\/63008"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media\/63006"}],"wp:attachment":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media?parent=63007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/categories?post=63007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/tags?post=63007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}