PHP domain name analysis_PHP tutorial

WBOY
Release: 2016-07-20 11:17:45
Original
1076 people have browsed it

php analysis domain name! How to write! You can get the domain name by calling

<ol class="dp-c">
<li class="alt"><span><span><?  </span></span></li><li><span class="comment">//转载保留来源于http://www.hake.cc/span><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>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/371964.htmlTechArticlephp analysis domain name! How to write! Can the domain name be obtained by calling? //Reprinted reserved from http://www.hake.cc/span // ####################### Analysis Domain name###################### functi...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!