{"id":21900,"date":"2020-02-03T23:16:58","date_gmt":"2020-02-03T15:16:58","guid":{"rendered":"http:\/\/4563.org\/?p=21900"},"modified":"2020-02-03T23:16:58","modified_gmt":"2020-02-03T15:16:58","slug":"php%e6%80%8e%e4%b9%88%e5%88%a4%e6%96%ad%e5%a4%9a%e4%b8%aa%e5%9f%9f%e5%90%8d%e8%bf%94%e5%9b%9e%e5%a4%9a%e4%b8%aa%e7%bb%93%e6%9e%9c%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=21900","title":{"rendered":"PHP\u600e\u4e48\u5224\u65ad\u591a\u4e2a\u57df\u540d\u8fd4\u56de\u591a\u4e2a\u7ed3\u679c\uff1f"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u6709\u5bb9\u4e43\u5927<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-15 23:07:13\t<\/p>\n<h3>PHP\u600e\u4e48\u5224\u65ad\u591a\u4e2a\u57df\u540d\u8fd4\u56de\u591a\u4e2a\u7ed3\u679c\uff1f<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 \u6709\u5bb9\u4e43\u5927 \u4e8e 2020-1-16 11:30 \u7f16\u8f91 <\/p>\n<p> \u6211\u60f3\u5b9e\u73b0\u7684\u662f<br \/>  A\u57df\u540d B\u57df\u540d C\u57df\u540d \u89e3\u6790\u4e00\u4e2a\u76ee\u5f55 \u4e00\u4e2aphp\u6587\u4ef6<\/p>\n<p>  A\u57df\u540d\u6253\u5f00 \u6807\u9898\u662fA1 \u5185\u5bb9\u662f A2<br \/>  B\u57df\u540d\u6253\u5f00 \u6807\u9898\u662fB1 \u5185\u5bb9\u662f B2 <br \/>  C\u57df\u540d\u6253\u5f00 \u6807\u9898\u662fC1 \u5185\u5bb9\u662f C2<\/p>\n<p>  \u8fd9\u4e9b\u52a8\u6001\u53c2\u6570\u7684\u5185\u5bb9 \u90fd\u5f04\u5230\u4e00\u4e2aphp\u6587\u4ef6\u5c31\u53ef\u4ee5\u4e86 <br \/>  :lol <\/p>\n<p>  \u6211\u73b0\u5728\u8bbe\u7f6e\u4e0b\u9762 \u57df\u540d1\u548c\u57df\u540d2\u540e <br \/>  \u53ea\u80fd\u751f\u6548\u4e00\u4e2a\u57df\u540d<\/p>\n<p>  &lt;?php<\/p>\n<p>  $domain = $_SERVER[&#8216;HTTP_HOST&#8217;];<br \/>  if($domain == &#8216;\u57df\u540d1.org&#8217;){<br \/>  $logo = &#8216;a.png&#8217;;<br \/>  $title = &#8216;a.com&#8217;;<br \/>  }<\/p>\n<p>  $domain = $_SERVER[&#8216;HTTP_HOST&#8217;];<br \/>  if($domain == &#8216;\u57df\u540d2.top&#8217;){<br \/>  $logo = &#8216;a.ccc.&nbsp; &nbsp; &nbsp; &nbsp; &#8216;;<br \/>  $title = &#8216;a.ccc.&nbsp; &nbsp; &nbsp; &nbsp; &#8216;;<br \/>  }<\/p>\n<p>  else{<br \/>  $logo = &#8216;b.png&#8217;;<br \/>  $title = &#8216;b.com&#8217;;<br \/>  }<br \/>  echo &quot;$logo &lt;hr&gt; $title&quot;;<\/p>\n<p>  ?&gt;  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u674e\u767d<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-15 23:15:03\t<\/p>\n<h3><\/h3>\n<p>  \t\tPHP\u4e0d\u77e5\u9053\uff0c\u6211\u89c9\u5f97\u53ef\u4ee5\u7528nginx\u53cd\u4ee3\u7136\u540e\u66ff\u6362\u5185\u5bb9\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>wangjiankai<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-15 23:18:50\t<\/p>\n<h3><\/h3>\n<p>  \t\t&lt;?php<br \/>  echo $_SERVER[&#8216;HTTP_HOST&#8217;];\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4e00\u4f4d\u4e0d\u77e5\u540d\u7f51\u53cb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 00:31:44\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u53ef\u4ee5PHP\u5224\u65ad\u5f53\u524d\u7f51\u9875\u57df\u540d \u7136\u540e\u663e\u793a\u5bf9\u5e94\u5185\u5bb9\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hanada<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 01:22:18\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6700\u7b80\u5355\u7c97\u66b4\u7684\u529e\u6cd5\u3002\u3002\u3002\u3002<br \/>  if(&quot;Domain A&quot; == $_SERVER[&#8216;HTTP_HOST&#8217;]) {<\/p>\n<p>  }else if (&quot;Domain B&quot; == $_SERVER[&#8216;HTTP_HOST&#8217;]) {<\/p>\n<p>  }else {<\/p>\n<p>  }\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6709\u5bb9\u4e43\u5927<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 11:31:49\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u66f4\u65b0\u4ee3\u7801\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6709\u5bb9\u4e43\u5927<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 13:15:16\t<\/p>\n<h3><\/h3>\n<p>  \t\thanada \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 01:22<br \/>  \u6700\u7b80\u5355\u7c97\u66b4\u7684\u529e\u6cd5\u3002\u3002\u3002\u3002<br \/>  if(&quot;Domain A&quot; == $_SERVER[&#8216;HTTP_HOST&#8217;]) {<\/p>\n<p> \u5927\u4f6c\u770b\u770b\u6211\u7684\u4ee3\u7801\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>xayle<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 13:33:51\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u8fd9\u4e2a\u7528 swith \u4e5f\u633a\u597d\u7528\u7684\u3002<\/p>\n<p>  &lt;?php<br \/>  switch ($_SERVER[&#8216;HTTP_HOST&#8217;])<br \/>  {<br \/>  case &#8216;\u57df\u540d1.org&#8217;:<br \/>  &nbsp; &nbsp; $logo = &#8216;a.png&#8217;;<br \/>  &nbsp; &nbsp; $title = &#8216;a.com&#8217;;<br \/>  &nbsp; &nbsp; break;<br \/>  case &#8216;\u57df\u540d2.top&#8217;:<br \/>  &nbsp; &nbsp; $logo = &#8216;a.ccc.&nbsp; &nbsp;&nbsp; &nbsp;&#8216;;<br \/>  &nbsp; &nbsp; $title = &#8216;a.ccc.&nbsp; &nbsp;&nbsp; &nbsp;&#8216;;<br \/>  &nbsp; &nbsp; break;<br \/>  default:<br \/>  &nbsp; &nbsp; $logo = &#8216;b.png&#8217;;<br \/>  &nbsp; &nbsp; $title = &#8216;b.com&#8217;;<br \/>  }<br \/>  echo &quot;$logo &lt;hr&gt; $title&quot;;  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>leven5<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 13:47:27\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5224\u65ad\u592a\u591a\u4e86\uff0c\u7528switch\u5427\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u6709\u5bb9\u4e43\u5927<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 14:17:34\t<\/p>\n<h3><\/h3>\n<p>  \t\txayle \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-16 13:33<br \/>  \u8fd9\u4e2a\u7528 swith \u4e5f\u633a\u597d\u7528\u7684\u3002<\/p>\n<p> xiexie \u5927\u4f6c\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5bb9\u4e43\u5927 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/21900"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21900"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/21900\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21900"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}