首頁  >  文章  >  後端開發  >  php分析域名_PHP教程

php分析域名_PHP教程

WBOY
WBOY原創
2016-07-20 11:17:451148瀏覽

php分析域名!写法方法!调用就可以得出域名

 

<ol class="dp-c">
<li class="alt"><span><span>  </span></span></li>
<li><span class="comment">//转载保留来源于http://www.hake.cc/span><span> </span></span></li>
<li class="alt">
<span class="comment">// ####################### 分析域名 ####################### </span><span> </span>
</li>
<li>
<span class="keyword">function</span><span> phpzygetname(</span><span class="vars">$url</span><span>)  </span>
</li>
<li class="alt"><span>{  </span></li>
<li>
<span class="vars">$referer</span><span> = preg_replace(</span><span class="string">"/https?://([^/]+).*/i"</span><span>, </span><span class="string">"1"</span><span>, </span><span class="vars">$url</span><span>);  </span>
</li>
<li class="alt">
<span class="vars">$referer</span><span> = </span><span class="func">str_replace</span><span>(</span><span class="string">"www."</span><span>, </span><span class="string">""</span><span>, </span><span class="vars">$referer</span><span>);  </span>
</li>
<li>
<span class="keyword">return</span><span> </span><span class="vars">$referer</span><span>;  </span>
</li>
<li class="alt"><span>}  </span></li>
<li><span>?>  </span></li>
</ol>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/371964.htmlTechArticlephp分析域名!写法方法!调用就可以得出域名 ? //转载保留来源于http://www.hake.cc/span // ####################### 分析域名 ####################### functi...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn