<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # php常用字符串函數 函數名| 描述 |實例 ---|---|--- trim() |刪除字符串兩端的空格或其他預定義字符| "$str = ""\r\nHello World!\r\n""; echo trim($str); rtrim() |刪除字符串右邊的空格或其他預定義字符 |"$str = ""Hello World!\n\n""; echo rtrim($str);" chop() |rtrim()的別名 同上| ltrim() |刪除字符串左邊的空格或其他預定義字符| "$str = ""\r\nHello World!""; echo ltrim($str);" dirname() |回路徑中的目錄部分(我們把它歸在了字符串函數里了)| echo dirname("c:/testweb/home.php"); str_pad() |把字符串填充為指定的長度| $str = "Hello World"; echo str_pad($str,20,"".""); str_repeat()| 重復使用指定字符串| echo str_repeat(".",13); str_split() |把字符串分割到數組中| print_r(str_split("Hello")); strrev() |反轉字符串 |echo strrev("Hello World!"); wordwrap() |按照指定長度對字符串進行折行處理 |"$str = ""An example on a long word is: Supercalifragulistic""; echo wordwrap($str,15);" str_shuffle()| 隨機地打亂字符串中所有字符| echo str_shuffle("Hello World"); parse_str() |將字符串解析成變量 |"parse_str(""id=23&name=John%20Adams"",$myArray); print_r($myArray);" number_format()| 通過千位分組來格式化數字 |"echo number_format(""1000000""); echo number_format(""1000000"",2); echo number_format(""1000000"",2,"","",""."");" strtolower()| 字符串轉為小寫 |echo strtolower("Hello WORLD!"); strtoupper()| 字符串轉為大寫| echo strtoupper("Hello WORLD!"); ucfirst() |字符串首字母大寫| echo ucfirst("hello world"); ucwords() |字符串每個單詞首字符轉為大寫| echo ucwords("hello world"); htmlentities()| 把字符轉為HTML實體| $str = ""John & 'Adams'""; echo htmlentities($str, ENT_COMPAT); htmlspecialchars()| 預定義字符轉html編碼 nl2br() |\n轉義為標簽 | echo nl2br("One line.\nAnother line."); strip_tags() | 剝去 HTML、XML 以及 PHP 的標簽 |echo strip_tags("Hello world!"); addcslashes() |在指定的字符前添加反斜線轉義字符串中字符 |$str = ""Hello, my name is John Adams." echo $str; echo addcslashes($str,'m');" stripcslashes() |刪除由addcslashes()添加的反斜線 |echo stripcslashes("Hello, \my na\me is Kai Ji\m."); addslashes() |指定預定義字符前添加反斜線 |$str = "Who's John Adams?";echo addslashes($str); stripslashes() |刪除由addslashes()添加的轉義字符| echo stripslashes("Who's John Adams?"); quotemeta() |在字符串中某些預定義的字符前添加反斜線| $str = ""Hello world. (can you hear me?)""; echo quotemeta($str); chr() |從指定的 ASCII 值返回字符| echo chr(052); ord() |返回字符串第一個字符的 ASCII值| echo ord("hello"); strcasecmp() |不區分大小寫比較兩字符串| echo strcasecmp("Hello world!","HELLO WORLD!"); strcmp() |區分大小寫比較兩字符串 | strncmp() |比較字符串前n個字符,區分大小寫 | strncasecmp() |比較字符串前n個字符,不區分大小寫 |int strncasecmp ( string $str1 , string $str2 , int $len ) strnatcmp() | 自然順序法比較字符串長度,區分大小寫 |int strnatcmp ( string $str1 , string $str2 ) strnatcasecmp() |自然順序法比較字符串長度,不區分大小寫| int strnatcasecmp ( string $str1 , string $str2 ) chunk_split() |將字符串分成小塊 |str chunk_split(str $body[,int $len[,str $end]]) strtok() |切開字符串 |str strtok(str $str,str $token) explode() |使用一個字符串為標志分割另一個字符串 |array explode(str $sep,str $str[,int $limit]) implode() |同join,將數組值用預訂字符連接成字符串| string implode ( string $glue , array $pieces ) substr() |截取字符串 |string substr ( string $string , int $start [, int $length ] ) str_replace() | 字符串替換操作,區分大小寫 |mix str_replace(mix $search,,mix $replace,mix $subject[,int &$num]) str_ireplace() |字符串替換操作,不區分大小寫 |mix str_ireplace ( mix $search , mix $replace , mix $subject [, int &$count ] ) substr_count() |統計一個字符串,在另一個字符串中出現次數 |int substr_count ( string $haystack , string $needle [, int $offset = 0 [, int $length ]] ) substr_replace() | 替換字符串中某串為另一個字符串 |mixed substr_replace ( mixed $string , string $replacement , int $start [, int $length ] ) similar_text() | 返回兩字符串相同字符的數量 |int similar_text(str $str1,str $str2) strchr() | 返回一個字符串在另一個字符串中開始位置到結束的字符串 |string strstr ( string $str, string $needle , bool $before_needle ) strrchr() | 返回一個字符串在另一個字符串中最后一次出現位置開始到末尾的字符串 |string strrchr ( string $haystack , mixed $needle ) stristr() | 返回一個字符串在另一個字符串中開始位置到結束的字符串,不區分大小寫 |string stristr ( string $haystack , mixed $needle [, bool $before_needle = false ] ) strtr() | 轉換字符串中的某些字符 |string strtr ( string $str , string $from , string $to ) strpos() | 尋找字符串中某字符最先出現的位置 |int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) stripos() | 尋找字符串中某字符最先出現的位置,不區分大小寫| int stripos ( string $haystack , string $needle [, int $offset ] ) strrpos() | 尋找某字符串中某字符最后出現的位置| int strrpos ( string $haystack , string $needle [, int $offset = 0 ] ) strripos() | 尋找某字符串中某字符最后出現的位置,不區分大小寫| int strripos ( string $haystack , string $needle [, int $offset ] ) strspn() | 返回字符串中首次符合mask的子字符串長度 |int strspn ( string $str1 , string $str2 [, int $start [, int $length ]] ) strcspn() |返回字符串中不符合mask的字符串的長度 |int strcspn ( string $str1 , string $str2 [, int $start [, int $length ]] ) str_word_count() | 統計字符串含有的單詞數 |mix str_word_count(str $str,[]) strlen() |統計字符串長度 |int strlen(str $str) count_chars() |統計字符串中所有字母出現次數(0..255) |mixed count_chars ( string $string [, int $mode ] ) md5() |字符串md5編碼 $str = ""Hello""; |echo md5($str) iconv | mb_substr |獲取字符串的部分 string mb_substr| ( string $str , int $start [, int $length = NULL [, string $encoding = mb_internal_encoding() ]] ) mb_http_output |設置/獲取 HTTP 輸出字符編碼 |mixed mb_http_output ([ string $encoding = mb_http_output() ] ) mb_strlen |獲取字符串的長度 |mixed mb_strlen ( string $str [, string $encoding = mb_internal_encoding() ] ) iconv |字符串按要求的字符編碼來轉換 |string iconv ( string $in_charset , string $out_charset , string $str ) iconv_substr | 截取字符串的部分 | iconv_get_encoding | 獲取 iconv 擴展的內部配置變量 | mb_substr_count |統計字符串出現的次數 | mb_check_encoding |檢查字符串在指定的編碼里是否有效 | mb_strrpos |查找字符串在一個字符串中最后出現的位置 | mb_split | 使用正則表達式分割多字節字符串| parse_url | 解釋URL成為一個數組 |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看