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

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

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

      <tfoot id='AMZOa'></tfoot>

      1. <small id='AMZOa'></small><noframes id='AMZOa'>

      2. PHP 將字符串拆分為整數(shù)元素和字符串

        PHP split string into integer element and string(PHP 將字符串拆分為整數(shù)元素和字符串)

        <small id='1btru'></small><noframes id='1btru'>

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

            <tbody id='1btru'></tbody>
            <legend id='1btru'><style id='1btru'><dir id='1btru'><q id='1btru'></q></dir></style></legend>
            • <bdo id='1btru'></bdo><ul id='1btru'></ul>
                • 本文介紹了PHP 將字符串拆分為整數(shù)元素和字符串的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我有一個(gè)字符串說(shuō):Order_num = "0982asdlkj"

                  我怎樣才能把它分成 2 個(gè)變量,用數(shù)字元素,然后在 php 中用字母元素另一個(gè)變量?

                  How can I split that into the 2 variables, with the number element and then another variable with the letter element in php?

                  number 元素可以是 1 到 4 之間的任意長(zhǎng)度,字母元素填充其余部分,使每個(gè) order_num 總共有 10 個(gè)字符.

                  The number element can be any length from 1 to 4 say and the letter element fills the rest to make every order_num 10 characters long in total.

                  我找到了 php explode 函數(shù)......但不知道如何在我的情況下實(shí)現(xiàn)它,因?yàn)閿?shù)字的數(shù)量在 1 到 4 之間,之后的字母是隨機(jī)的,所以無(wú)法在特定字母處拆分.請(qǐng)盡可能具體的幫助!

                  I have found the php explode function...but don't know how to make it in my case because the number of numbers is between 1 and 4 and the letters are random after that, so no way to split at a particular letter. Please help as specifically as possible!

                  推薦答案

                  您可以使用 preg_split 使用 前瞻和后視:

                  print_r(preg_split('#(?<=d)(?=[a-z])#i', "0982asdlkj"));
                  

                  印刷品

                  Array
                  (
                      [0] => 0982
                      [1] => asdlkj
                  )
                  

                  這僅在字母部分確實(shí)只包含字母而沒(méi)有數(shù)字時(shí)才有效.

                  This only works if the letter part really only contains letters and no digits.

                  更新:

                  只是為了澄清這里發(fā)生的事情:

                  Just to clarify what is going on here:

                  正則表達(dá)式查看每個(gè)位置,如果該位置之前有一個(gè)數(shù)字((?<=d))之后的一個(gè)字母((?=[az])),然后它匹配并且字符串在這個(gè)位置被拆分.整個(gè)事情不區(qū)分大小寫(xiě)(i).

                  The regular expressions looks at every position and if a digit is before that position ((?<=d)) and a letter after it ((?=[a-z])), then it matches and the string gets split at this position. The whole thing is case-insensitive (i).

                  這篇關(guān)于PHP 將字符串拆分為整數(shù)元素和字符串的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 可滾動(dòng)游標(biāo)不起作用)
                  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 獲取一個(gè)值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                    <legend id='QJjRn'><style id='QJjRn'><dir id='QJjRn'><q id='QJjRn'></q></dir></style></legend>
                    <i id='QJjRn'><tr id='QJjRn'><dt id='QJjRn'><q id='QJjRn'><span id='QJjRn'><b id='QJjRn'><form id='QJjRn'><ins id='QJjRn'></ins><ul id='QJjRn'></ul><sub id='QJjRn'></sub></form><legend id='QJjRn'></legend><bdo id='QJjRn'><pre id='QJjRn'><center id='QJjRn'></center></pre></bdo></b><th id='QJjRn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QJjRn'><tfoot id='QJjRn'></tfoot><dl id='QJjRn'><fieldset id='QJjRn'></fieldset></dl></div>
                    <tfoot id='QJjRn'></tfoot>

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

                        • <bdo id='QJjRn'></bdo><ul id='QJjRn'></ul>
                            <tbody id='QJjRn'></tbody>
                            主站蜘蛛池模板: av黄色在线 | 亚洲h在线观看 | 一区二区在线 | 亚洲视频在线观看 | 亚洲男女视频在线观看 | 久久久久久91香蕉国产 | 毛片国产 | 91精品福利| 性高湖久久久久久久久3小时 | 久久av网| www.国产一区| 久久久久www | 日韩一区二区久久 | 国产探花在线精品一区二区 | 国产精品a久久久久 | 免费成人在线网站 | 欧美激情视频一区二区三区免费 | 国产欧美一区二区精品久导航 | 男女羞羞视频免费看 | 91xh98hx 在线 国产 | 少妇一级淫片免费播放 | av网站在线免费观看 | 国产精品美女一区二区 | www.国产一区 | 欧美99 | 国产91av视频在线观看 | 国产精品综合久久 | 99久久日韩精品免费热麻豆美女 | 成人av影院 | 一区免费 | 欧美日韩国产免费 | 81精品国产乱码久久久久久 | 久久亚洲一区 | 蜜桃av鲁一鲁一鲁一鲁 | 国产综合久久 | 久久在线精品 | 理论片免费在线观看 | 国产免费一区二区三区 | 成人精品视频在线观看 | 欧美三级在线 | 国产精品久久久久久妇女6080 |