久久久久久久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 空白字符的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

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

                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 產(chǎn)生這個結(jié)果:

                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"
                ]
                

                數(shù)組 "1 => b"bw4 05/09/19"" 中的 #1 項不正確,我無法弄清楚數(shù)組值前面的字母 "b" 是什么.此外,bw4"和05/09/19"之間的空格非常感謝有關(guān)如何更好地實現(xiàn)字符串拆分的任何建議.這是原始字符串:https://3v4l.org/2L35M,這是我的結(jié)果圖像本地主機: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 也已經(jīng)匹配制表符了),但是由于缺少 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 演示 產(chǎn)出

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

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

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

                相關(guān)文檔推薦

                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 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)
                  <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>

                          主站蜘蛛池模板: 玩丰满女领导对白露脸hd | 亚洲天堂成人在线视频 | 做a的各种视频 | 精品免费国产视频 | 中文字幕一区二区三区四区 | av电影一区二区 | 久久1区| 色爽女 | 国产成人免费视频网站视频社区 | 毛片大全 | 精品一区二区三区在线播放 | 国产精品不卡视频 | 操久久久 | 久久99网站| 亚洲欧美成人 | 欧美一二区 | 日韩第一区 | 国产成人99久久亚洲综合精品 | 亚洲午夜精品视频 | 久久久久久美女 | 精品日韩在线 | 青青久草 | 国产在线视频一区 | 精品久久国产 | 日韩视频精品在线 | 久久黄色精品视频 | 国产性色视频 | 中文字幕在线观看一区 | 成年人在线观看 | 日本在线观看网址 | 日日操夜夜操天天操 | 伊人久久伊人 | 欧洲一级毛片 | 国产91中文 | 欧美久久一区 | 成人一区二区视频 | 91精品久久久久久久 | 日韩看片| 91久久国产综合久久 | 一区二区三区在线观看视频 | 日日射影院|