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

    <tfoot id='xCFJZ'></tfoot>

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

          <bdo id='xCFJZ'></bdo><ul id='xCFJZ'></ul>

        PHP中如何判斷字母是大寫還是小寫?

        How to check if letter is upper or lower in PHP?(PHP中如何判斷字母是大寫還是小寫?)
          <bdo id='clGXS'></bdo><ul id='clGXS'></ul>

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

              <legend id='clGXS'><style id='clGXS'><dir id='clGXS'><q id='clGXS'></q></dir></style></legend>
                  本文介紹了PHP中如何判斷字母是大寫還是小寫?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我也有帶有變音符號的 UTF-8 文本,想檢查該文本的第一個字母是大寫還是小寫.如何做到這一點?

                  I have texts in UTF-8 with diacritic characters also, and would like to check if first letter of this text is upper case or lower case. How to do this?

                  推薦答案

                  我認為,與此處發布的其他解決方案相比,進行 preg_ 調用是最直接、簡潔和可靠的調用.

                  It is my opinion that making a preg_ call is the most direct, concise, and reliable call versus the other posted solutions here.

                  echo preg_match('~^p{Lu}~u', $string) ? 'upper' : 'lower';
                  

                  我的模式分解:

                  ~      # starting pattern delimiter 
                  ^      #match from the start of the input string
                  p{Lu} #match exactly one uppercase letter (unicode safe)
                  ~      #ending pattern delimiter 
                  u      #enable unicode matching
                  

                  ctype_<時請注意'a' 在這一系列測試中失敗了.

                  Please take notice when ctype_ and < 'a' fail with this battery of tests.

                  代碼:(演示)

                  $tests = ['aa', 'Bbbbb', 'éé', 'iou', 'Δδ'];
                  
                  foreach ($tests as $test) {
                      echo "
                  {$test}:";
                      echo "
                  	PREG:  " , preg_match('~^p{Lu}~u', $test)      ? 'upper' : 'lower';
                      echo "
                  	CTYPE: " , ctype_upper(mb_substr($test, 0, 1))  ? 'upper' : 'lower';
                      echo "
                  	< a:   " , mb_substr($test, 0, 1) < 'a'         ? 'upper' : 'lower';
                  
                      $chr = mb_substr ($test, 0, 1, "UTF-8");
                      echo "
                  	MB:    " , mb_strtoupper($chr, "UTF-8") == $chr ? 'upper' : 'lower';
                  }
                  

                  輸出:

                  aa:
                      PREG:  lower
                      CTYPE: lower
                      < a:   lower
                      MB:    lower
                  Bbbbb:
                      PREG:  upper
                      CTYPE: upper
                      < a:   upper
                      MB:    upper
                  éé:               <-- trouble
                      PREG:  upper
                      CTYPE: lower  <-- uh oh
                      < a:   lower  <-- uh oh
                      MB:    upper
                  iou:
                      PREG:  lower
                      CTYPE: lower
                      < a:   lower
                      MB:    lower
                  Δδ:               <-- extended beyond question scope
                      PREG:  upper  <-- still holding up
                      CTYPE: lower
                      < a:   lower
                      MB:    upper  <-- still holding up
                  

                  如果有人需要區分大寫字母、小寫字母和非字母,請參閱這篇文章.

                  If anyone needs to differentiate between uppercase letters, lowercase letters, and non-letters see this post.

                  這可能把這個問題的范圍擴展得太遠了,但如果你輸入的字符特別松散(它們可能不存在于Lu可以處理的類別中),你可能需要檢查一下第一個字符有大小寫變體:

                  It may be extending the scope of this question too far, but if your input characters are especially squirrelly (they might not exist in a category that Lu can handle), you may want to check if the first character has case variants:

                  p{L&} 或 p{Cased_Letter}:存在大小寫變體的字母(Ll、Lu 和 Lt 的組合).

                  p{L&} or p{Cased_Letter}: a letter that exists in lowercase and uppercase variants (combination of Ll, Lu and Lt).

                  • 來源:https://www.regular-expressions.info/unicode.html
                  • 要包含帶有 SMALL 變體的羅馬數字(數字字母"),如有必要,您可以將該額外范圍添加到模式中.

                    To include Roman Numerals ("Number Letters") with SMALL variants, you can add that extra range to the pattern if necessary.

                    https://www.fileformat.info/info/unicode/category/Nl/list.htm

                    代碼:(演示)

                    echo preg_match('~^[p{Lu}x{2160}-x{216F}]~u', $test) ? 'upper' : 'not upper';
                    

                    這篇關于PHP中如何判斷字母是大寫還是小寫?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='0TcR5'></tbody>
                      • <small id='0TcR5'></small><noframes id='0TcR5'>

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

                            主站蜘蛛池模板: 亚洲国产一区二区三区在线观看 | 久久视频免费看 | 91精品久久久久久久久 | 影视一区| 性色综合 | 国产1区2区在线观看 | 蜜桃av鲁一鲁一鲁一鲁 | 在线中文字幕亚洲 | 亚洲精品高清视频在线观看 | 日韩一区二区在线免费观看 | 国产在线1 | 精品国产乱码久久久久久老虎 | 成人国产一区二区三区精品麻豆 | 国产欧美精品一区二区 | 日本久久精品视频 | 成人中文网 | аⅴ资源新版在线天堂 | 久久久久高清 | 黄色片免费看 | 久热久热| 成人免费视频网站在线看 | 国产 日韩 欧美 在线 | 免费簧片视频 | 久久久精品一区二区 | 免费一二区 | 日韩一区二区在线播放 | www国产精品 | 一级看片免费视频囗交动图 | 午夜影院在线观看 | 国产精品免费一区二区三区四区 | 免费观看一级特黄欧美大片 | 久久视频免费观看 | 在线播放国产一区二区三区 | 国产精品视频97 | 精品亚洲一区二区三区四区五区 | 久久草在线视频 | 四虎永久影院 | 亚洲综合在线播放 | 亚洲精品在 | 91网站视频在线观看 | 伊人免费视频二 |