<small id='wU7ju'></small><noframes id='wU7ju'>

    <tfoot id='wU7ju'></tfoot>
    • <bdo id='wU7ju'></bdo><ul id='wU7ju'></ul>

      <i id='wU7ju'><tr id='wU7ju'><dt id='wU7ju'><q id='wU7ju'><span id='wU7ju'><b id='wU7ju'><form id='wU7ju'><ins id='wU7ju'></ins><ul id='wU7ju'></ul><sub id='wU7ju'></sub></form><legend id='wU7ju'></legend><bdo id='wU7ju'><pre id='wU7ju'><center id='wU7ju'></center></pre></bdo></b><th id='wU7ju'></th></span></q></dt></tr></i><div id='wU7ju'><tfoot id='wU7ju'></tfoot><dl id='wU7ju'><fieldset id='wU7ju'></fieldset></dl></div>

        <legend id='wU7ju'><style id='wU7ju'><dir id='wU7ju'><q id='wU7ju'></q></dir></style></legend>
      1. PHP:从字符串中的 URL 中删除“WWW"

        PHP: Remove #39;WWW#39; from URL inside a String(PHP:从字符串中的 URL 中删除“WWW)
        <legend id='rLDUq'><style id='rLDUq'><dir id='rLDUq'><q id='rLDUq'></q></dir></style></legend>

          <tbody id='rLDUq'></tbody>
        <i id='rLDUq'><tr id='rLDUq'><dt id='rLDUq'><q id='rLDUq'><span id='rLDUq'><b id='rLDUq'><form id='rLDUq'><ins id='rLDUq'></ins><ul id='rLDUq'></ul><sub id='rLDUq'></sub></form><legend id='rLDUq'></legend><bdo id='rLDUq'><pre id='rLDUq'><center id='rLDUq'></center></pre></bdo></b><th id='rLDUq'></th></span></q></dt></tr></i><div id='rLDUq'><tfoot id='rLDUq'></tfoot><dl id='rLDUq'><fieldset id='rLDUq'></fieldset></dl></div>
              <bdo id='rLDUq'></bdo><ul id='rLDUq'></ul>

                  <tfoot id='rLDUq'></tfoot>
                1. <small id='rLDUq'></small><noframes id='rLDUq'>

                  本文介绍了PHP:从字符串中的 URL 中删除“WWW"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  目前我正在使用 parse_url,但是数组的主机项还包括我不想要的WWW"部分.我将如何删除它?

                  Currently I am using parse_url, however the host item of the array also includes the 'WWW' part which I do not want. How would I go about removing this?

                  $parse = parse_url($url);
                  print_r($parse);
                  $url = $parse['host'] . $parse['path'];
                  echo $url;
                  

                  推荐答案

                  $url = preg_replace('#^www.(.+.)#i', '$1', $parse['host']) . $parse['path'];
                  

                  这不会删除 www.com 中的 www,但 www.www.com 会导致 www.com.

                  This won't remove the www in www.com, but www.www.com results in www.com.

                  这篇关于PHP:从字符串中的 URL 中删除“WWW"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Limit amount of links shown with Laravel pagination(限制 Laravel 分页显示的链接数量)
                  How to implement pagination on a custom WP_Query Ajax(如何在自定义 WP_Query Ajax 上实现分页)
                  MYSQL query with PHP pagination(带有 PHP 分页的 MYSQL 查询)
                  How to do a pagination from array?(如何从数组进行分页?)
                  How to paginate query results for Infinite Scroll?(如何为无限滚动的查询结果分页?)
                  Searching for advanced php/mysql pagination script(搜索高级 php/mysql 分页脚本)
                      <tbody id='v1yQJ'></tbody>
                        1. <tfoot id='v1yQJ'></tfoot>
                          <i id='v1yQJ'><tr id='v1yQJ'><dt id='v1yQJ'><q id='v1yQJ'><span id='v1yQJ'><b id='v1yQJ'><form id='v1yQJ'><ins id='v1yQJ'></ins><ul id='v1yQJ'></ul><sub id='v1yQJ'></sub></form><legend id='v1yQJ'></legend><bdo id='v1yQJ'><pre id='v1yQJ'><center id='v1yQJ'></center></pre></bdo></b><th id='v1yQJ'></th></span></q></dt></tr></i><div id='v1yQJ'><tfoot id='v1yQJ'></tfoot><dl id='v1yQJ'><fieldset id='v1yQJ'></fieldset></dl></div>

                          <small id='v1yQJ'></small><noframes id='v1yQJ'>

                          <legend id='v1yQJ'><style id='v1yQJ'><dir id='v1yQJ'><q id='v1yQJ'></q></dir></style></legend>
                            <bdo id='v1yQJ'></bdo><ul id='v1yQJ'></ul>