久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <tfoot id='uSxdW'></tfoot>

    2. <small id='uSxdW'></small><noframes id='uSxdW'>

    3. <legend id='uSxdW'><style id='uSxdW'><dir id='uSxdW'><q id='uSxdW'></q></dir></style></legend>
        <bdo id='uSxdW'></bdo><ul id='uSxdW'></ul>
      <i id='uSxdW'><tr id='uSxdW'><dt id='uSxdW'><q id='uSxdW'><span id='uSxdW'><b id='uSxdW'><form id='uSxdW'><ins id='uSxdW'></ins><ul id='uSxdW'></ul><sub id='uSxdW'></sub></form><legend id='uSxdW'></legend><bdo id='uSxdW'><pre id='uSxdW'><center id='uSxdW'></center></pre></bdo></b><th id='uSxdW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uSxdW'><tfoot id='uSxdW'></tfoot><dl id='uSxdW'><fieldset id='uSxdW'></fieldset></dl></div>

      使用 PHP 正則表達式匹配字符串中的任何 Unicode

      Matching any Unicode whitespace characters in a string with PHP regex(使用 PHP 正則表達式匹配字符串中的任何 Unicode 空白字符)
        <tbody id='OmD4f'></tbody>

            <bdo id='OmD4f'></bdo><ul id='OmD4f'></ul>
            • <small id='OmD4f'></small><noframes id='OmD4f'>

            • <legend id='OmD4f'><style id='OmD4f'><dir id='OmD4f'><q id='OmD4f'></q></dir></style></legend>
            • <i id='OmD4f'><tr id='OmD4f'><dt id='OmD4f'><q id='OmD4f'><span id='OmD4f'><b id='OmD4f'><form id='OmD4f'><ins id='OmD4f'></ins><ul id='OmD4f'></ul><sub id='OmD4f'></sub></form><legend id='OmD4f'></legend><bdo id='OmD4f'><pre id='OmD4f'><center id='OmD4f'></center></pre></bdo></b><th id='OmD4f'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OmD4f'><tfoot id='OmD4f'></tfoot><dl id='OmD4f'><fieldset id='OmD4f'></fieldset></dl></div>
              <tfoot id='OmD4f'></tfoot>
                本文介紹了使用 PHP 正則表達式匹配字符串中的任何 Unicode 空白字符的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我想在每個空間將文本消息拆分成數組.在我收到這條短信之前,它一直工作得很好.下面是處理文本字符串的幾行代碼:

                I want to split text message into array at every Space. It's been working just fine until I received this text message. Here is the few code lines that process the text string:

                    $str = 'T bw4??05/09/19 07:51 am BW6N 499.803';
                    $cleanStr = iconv("UTF-8", "ISO-8859-1", $str);
                    $strArr = preg_split('/[s	]/', $cleanStr);
                    var_dump($strArr);
                

                Var_dump 產生這個結果:

                Var_dump yields this result:

                array:6 [▼
                 0 => "T"
                 1 => b"bw4  05/09/19"
                 2 => "07:51"
                 3 => "am"
                 4 => "BW6N"
                 5 => "499.803"
                ]
                

                數組 "1 => b"bw4 05/09/19"" 中的 #1 項不正確,我無法弄清楚數組值前面的字母 "b" 是什么.此外,bw4"和05/09/19"之間的空格非常感謝有關如何更好地實現字符串拆分的任何建議.這是原始字符串:https://3v4l.org/2L35M,這是我的結果圖像本地主機:http://prntscr.com/jjbvny

                The #1 item in the array "1 => b"bw4 05/09/19"" in not correct, I am not able figure out what is the letter "b" in front of the array value. Also, the space(es) between "bw4" and "05/09/19" Any suggestion on how better achieve the string splitting are greatly appreciated. Here is the original string: https://3v4l.org/2L35M and here is the image of result from my localhost: http://prntscr.com/jjbvny

                推薦答案

                要匹配您可能使用的任何 1 個或多個 Unicode 空白字符

                To match any 1 or more Unicode whitespace chars you may use

                '~s+~u'
                

                您的 '/[s ]/' 模式僅匹配單個空白字符 (s) 或制表符 ( )(這當然是多余的,因為 s 也已經匹配制表符了),但是由于缺少 u 修飾符,s 無法匹配 bw4 之后的 u00A0 字符(硬空格).

                Your '/[s ]/' pattern only matches a single whitespace char (s) or a tab ( ) (which is of course redundant as s already matches tabs, too), but since the u modifier is missing, the s cannot match the u00A0 chars (hard spaces) you have after bw4.

                所以,使用

                $str = 'T bw4??05/09/19 07:51 am BW6N 499.803';
                $strArr = preg_split('/s+/u', $str);
                print_r($strArr);
                

                查看 PHP 演示 產出

                Array
                (
                    [0] => T
                    [1] => bw4
                    [2] => 05/09/19
                    [3] => 07:51
                    [4] => am
                    [5] => BW6N
                    [6] => 499.803
                )
                

                這篇關于使用 PHP 正則表達式匹配字符串中的任何 Unicode 空白字符的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                  <tbody id='H6Pun'></tbody>
                  <bdo id='H6Pun'></bdo><ul id='H6Pun'></ul>

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

                    1. <i id='H6Pun'><tr id='H6Pun'><dt id='H6Pun'><q id='H6Pun'><span id='H6Pun'><b id='H6Pun'><form id='H6Pun'><ins id='H6Pun'></ins><ul id='H6Pun'></ul><sub id='H6Pun'></sub></form><legend id='H6Pun'></legend><bdo id='H6Pun'><pre id='H6Pun'><center id='H6Pun'></center></pre></bdo></b><th id='H6Pun'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='H6Pun'><tfoot id='H6Pun'></tfoot><dl id='H6Pun'><fieldset id='H6Pun'></fieldset></dl></div>

                      • <tfoot id='H6Pun'></tfoot>
                      • <legend id='H6Pun'><style id='H6Pun'><dir id='H6Pun'><q id='H6Pun'></q></dir></style></legend>

                          主站蜘蛛池模板: 国产精品a级 | 蜜桃av鲁一鲁一鲁一鲁 | 成年人视频在线免费观看 | 天天插天天操 | 亚洲精品成人网 | 久久这里有精品 | 久久一区二区三区免费 | 久久久久久久国产 | 日本综合在线观看 | 免费不卡av| 亚洲一区精品在线 | 夜夜草| 国产99热精品 | 日韩视频在线观看一区二区 | 一区二区av | 91精品国产综合久久久动漫日韩 | 神马福利 | 久久久久亚洲 | 久久精品视频9 | 亚洲欧美少妇 | 最近日韩中文字幕 | 暖暖成人免费视频 | 欧美精品一级 | 久久99精品久久久水蜜桃 | 一区二区三区免费在线观看 | 久久精品二区亚洲w码 | 亚洲国产一区二区三区 | 超碰在线人人干 | 亚洲国产成人在线 | 在线观看涩涩视频 | 麻豆精品久久久 | 欧美黑人一级爽快片淫片高清 | 亚洲欧美日韩国产综合 | 伊人久麻豆社区 | 亚洲精品久久久久久一区二区 | 日韩免费视频 | 国产成年人小视频 | 欧美二区三区 | 亚洲欧美激情国产综合久久久 | 中文字幕日韩一区 | 亚洲人人 |