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

                ## 去空格或或其他字符: trim() 刪除字符串兩端的空格或其他預定義字符 ~~~ "\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"); ` 一個包含路徑的字符串 返回文件路徑的目錄部分//c:/testweb   ## 字符串生成與轉化: str_pad() 把字符串填充為指定的長度 ~~~ $str = "Hello World"; echo str_pad($str,20,"."); ~~~ 要填充的字符串|新字符串的長度|供填充使用的字符串,默認是空白 完成后的字符串   str_repeat() 重復使用指定字符串 ~~~ echo str_repeat(".",13); ~~~ 要重復的字符串|字符串將被重復的次數 13個點 str_split() 把字符串分割到數組中 ~~~ print_r(str_split("Hello")); ~~~ 要分割的字符串|每個數組元素的長度,默認1 拆分后的字符串數組   strrev() 反轉字符串 ~~~ echo strrev("Hello World!"); ~~~ 目標字符串 顛倒順序后的字符串!dlroW olleH 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); ~~~ 要解析的字符串|存儲變量的數組名稱 返回 ~~~ Array( [id] => 23 [name] => John Adams)   ~~~ number_format() 通過千位分組來格式化數字 要格式化的數字|規定多少個小數|規定用作小數點的字符串|規定用作千位分隔符的字符串 ~~~ 1,000,000 1,000,000.00 1.000.000,00 ~~~ ## 大小寫轉換: strtolower() 字符串轉為小寫 ~~~ echo strtolower("Hello WORLD!"); ~~~ 目標字符串 小寫字符串   strtoupper() 字符串轉為大寫 ~~~ echo strtoupper("Hello WORLD!");   ~~~ 大寫字符串   ucfirst() 字符串首字母大寫 ~~~ echo ucfirst("hello world");   ~~~ Hello world   ucwords() 字符串每個單詞首字符轉為大寫 ~~~ echo ucwords("hello world");   Hello World   ~~~ ## html標簽關聯: htmlentities() 把字符轉為HTML實體 ~~~ $str = "John & 'Adams'"; echo htmlentities($str, ENT_COMPAT);   John & 'Adams' ~~~ htmlspecialchars() 預定義字符轉html編碼 nl2br() ~~~ \n轉義為<br>標簽 echo nl2br("One line.\nAnother line.");   ~~~ 處理后的字符串   strip_tags() 剝去 HTML、XML 以及 PHP 的標簽 ~~~ echo strip_tags("Hello <b>world!</b>");       ~~~ 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."); 目標字符串 Hello, my name is Kai Jim.   ~~~ addslashes() 指定預定義字符前添加反斜線 ~~~ $str = "Who's John Adams?"; echo addslashes($str); ~~~ 把目標串中的' " \和null進行轉義處理   stripslashes() 刪除由addslashes()添加的轉義字符 ~~~ echo stripslashes("Who\'s John Adams?");   清除轉義符號Who's John Adams? ~~~ quotemeta() 在字符串中某些預定義的字符前添加反斜線 ~~~ $str = "Hello world. (can you hear me?)"; echo quotemeta($str);   Hello world\. \(can you hear me\?\) . \ + * ? [] ^ $ () ~~~ chr() 從指定的 ASCII 值返回字符 ~~~ echo chr(052); ~~~ ASCII 值 返回對應的字符//*   ord() 返回字符串第一個字符的 ASCII 值 ~~~ echo ord("hello"); ~~~ 字符串 第一個字符的 ASCII 值 ## 字符串比較: strcasecmp() 不區分大小寫比較兩字符串 ~~~ echo strcasecmp("Hello world!","HELLO WORLD!"); ~~~ 兩個目標字符串 大1|等0|小-1 strcmp() 區分大小寫比較兩字符串   strncmp() 比較字符串前n個字符,區分大小寫 ~~~ int strncmp ( string $str1 , string $str2 , int $len ) ~~~ 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]]) $body目標字串,$len長度,$str插入結束符 分割后的字符串 ~~~   strtok() 切開字符串 `str strtok(str $str,str $token) 目標字符串$str,以$token為標志切割 返回切割后的字符串   ` explode() 使用一個字符串為標志分割另一個字符串 ~~~ array explode(str $sep,str $str[,int $limit]) $sep為分割符,$str目標字符串,$limit返回數組最多包含元素數 字符串被分割后形成的數組 ~~~ implode() 同join,將數組值用預訂字符連接成字符串 ~~~ string implode ( string $glue , array $pieces ) $glue默認,用''則直接相連     ~~~ substr() 截取字符串 ~~~ string substr ( string $string , int $start [, int $length ] )   ~~~ ## 字符串查找替換: str_replace() 字符串替換操作,區分大小寫 ~~~ mix str_replace(mix $search,,mix $replace,mix $subject[,int &$num]) $search查找的字符串,$replace替換的字符串,$subject被查找字串,&$num 返回替換后的結果 ~~~ str_ireplace() 字符串替換操作,不區分大小寫 ~~~ mix str_ireplace ( mix $search , mix $replace , mix $subject [, int &$count ] ) $search查找的字符串,$replace替換的字符串,$subject被查找字串,&$num 返回替換后的結果   ~~~ 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) 兩個比較的字符串 整形,相同字符數量   ~~~ strrchr() 返回一個字符串在另一個字符串中最后一次出現位置開始到末尾的字符串 ~~~ string strrchr ( string $haystack , mixed $needle )   ~~~ strstr() 返回一個字符串在另一個字符串中開始位置到結束的字符串 ~~~ string strstr ( string $str, string $needle , bool $before_needle )       ~~~ strchr() strstr()的別名,返回一個字符串在另一個字符串中首次出現的位置開始到末尾的字符串 ~~~ string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] ) ~~~ 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 ]] ) $str1被查詢,$str2查詢字符串,$start開始查詢的字符,$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); ~~~
                  <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>

                              哎呀哎呀视频在线观看