{"id":18274,"date":"2024-07-27T21:54:13","date_gmt":"2024-07-27T13:54:13","guid":{"rendered":"https:\/\/0592ban.cn\/?p=18274"},"modified":"2024-07-27T21:54:13","modified_gmt":"2024-07-27T13:54:13","slug":"71%e5%b9%b4%e7%94%9f55%e5%b2%81%e9%80%80%e4%bc%91%e6%98%af%e4%bb%80%e4%b9%88%e5%b9%b4-71%e5%b9%b4%e7%94%9f55%e5%b2%81%e9%80%80%e4%bc%91%e6%98%af%e5%93%aa%e4%b8%80%e5%b9%b4%e7%9a%84","status":"publish","type":"post","link":"https:\/\/0592ban.cn\/index.php\/2024\/07\/27\/71%e5%b9%b4%e7%94%9f55%e5%b2%81%e9%80%80%e4%bc%91%e6%98%af%e4%bb%80%e4%b9%88%e5%b9%b4-71%e5%b9%b4%e7%94%9f55%e5%b2%81%e9%80%80%e4%bc%91%e6%98%af%e5%93%aa%e4%b8%80%e5%b9%b4%e7%9a%84\/","title":{"rendered":"71\u5e74\u751f55\u5c81\u9000\u4f11\u662f\u4ec0\u4e48\u5e74 (71\u5e74\u751f55\u5c81\u9000\u4f11\u662f\u54ea\u4e00\u5e74\u7684)"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"71\u5e74\u751f55\u5c81\u9000\u4f11\u662f\u54ea\u4e00\u5e74\u7684\" loading=\"lazy\" src=\"https:\/\/0592ban.cn\/wp-content\/uploads\/2024\/07\/b5361a03-abef-43f9-9df5-b83ac42bd60b.jpg\"\/><\/p>\n<p>\n \u8f93\u5165\u60a8\u7684\u51fa\u751f\u65e5\u671f\uff0c\u5373\u53ef\u67e5\u8be2\u60a8\u7684\u6cd5\u5b9a\u9000\u4f11\u5e74\u9f84\u548c\u9884\u8ba1\u9000\u4f11\u65f6\u95f4\u3002\n<\/p>\n<form action=\"\" method=\"post\">\n <label for=\"birthdate\"><br \/>\n  \u51fa\u751f\u65e5\u671f\uff1a<br \/>\n <\/label><br \/>\n <input id=\"birthdate\" name=\"birthdate\" type=\"date\"\/><br \/>\n <input type=\"submit\" value=\"\u67e5\u8be2\"\/><br \/>\n<\/form>\n<p>\n<!--?php\n    if (isset($_POST['birthdate'])) {\n      $birthdate = $_POST['birthdate'];\n      $birthdate = new DateTime($birthdate);\n      $gender = isset($_POST['gender']) ? $_POST['gender'] : 'male';\n\n      $retirementAge = getRetirementAge($birthdate, $gender);\n      $retirementDate = getRetirementDate($birthdate, $retirementAge);\n\n      echo \"\n\n<table border=\\\"1\\\" cellpadding=\\\"5\\\" cellspacing=\\\"0\\\"-->\n&#8220;;<br \/>\n      echo &#8220;\u6027\u522b\u51fa\u751f\u65e5\u671f\u6cd5\u5b9a\u9000\u4f11\u5e74\u9f84\u9884\u8ba1\u9000\u4f11\u65f6\u95f4&#8221;;<br \/>\n      echo &#8220;$gender$birthdate-&gt;format(&#8216;Y-m-d&#8217;)$retirementAge \u5468\u5c81$retirementDate&#8221;;<br \/>\n      echo &#8220;&#8221;;<br \/>\n    }<\/p>\n<p>    function getRetirementAge($birthdate, $gender) {<br \/>\n      $retirementAge =60;<br \/>\n      if ($gender === &#8216;female&#8217;) {<br \/>\n        $retirementAge = 55;<br \/>\n      }<\/p>\n<p>      return $retirementAge;<br \/>\n    }<\/p>\n<p>    function getRetirementDate($birthdate, $retirementAge) {<br \/>\n      $retirementDate = $birthdate-&gt;add(new DateInterval(&#8216;P&#8217; . $retirementAge . &#8216;Y&#8217;));<br \/>\n      return $retirementDate-&gt;format(&#8216;Y-m-d&#8217;);<br \/>\n    }<br \/>\n  ?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f93\u5165\u60a8\u7684\u51fa\u751f\u65e5\u671f\uff0c\u5373\u53ef\u67e5\u8be2\u60a8\u7684\u6cd5\u5b9a\u9000\u4f11\u5e74\u9f84\u548c\u9884\u8ba1\u9000\u4f11\u65f6\u95f4\uff0c\u51fa\u751f\u65e5\u671f\uff0cecho\u6027\u522b\u51fa\u751f\u65e5\u671f\u6cd5\u5b9a\u9000\u4f11\u5e74\u9f84\u9884\u8ba1\u9000\u4f11\u65f6\u95f4\uff0cecho$gender$birthdate\uff0c&#038;gt\uff0cformat\uff0cY\uff0cm\uff0cd\uff0c$retirementAge\u5468\u5c81$retirementDate\uff0cecho\uff0cfunctiongetRetirementAge\uff0c$birthda&#8230;\u3002<\/p>\n","protected":false},"author":1,"featured_media":18273,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8127],"class_list":["post-18274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12shengxiao","tag-8127"],"_links":{"self":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/18274","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=18274"}],"version-history":[{"count":1,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/18274\/revisions"}],"predecessor-version":[{"id":18275,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/posts\/18274\/revisions\/18275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media\/18273"}],"wp:attachment":[{"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/media?parent=18274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/categories?post=18274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0592ban.cn\/index.php\/wp-json\/wp\/v2\/tags?post=18274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}