PHP字串處理函數大全

來源:互聯網
上載者:User
  • addcslashes — 以 C 語言風格使用反斜線逸出字元串中的字元
  • addslashes — 使用反斜線引用字串
  • bin2hex — 將位元據轉換成十六進位表示
  • chop — rtrim 的別名
  • chr — 返回指定的字元
  • chunk_split — 將字串分割成小塊
  • convert_cyr_string — 將字元由一種 Cyrillic 字元轉換成另一種
  • convert_uudecode — 解碼一個 uuencode 編碼的字串
  • convert_uuencode — 使用 uuencode 編碼一個字串
  • count_chars — 返回字串所用字元的資訊
  • crc32 — 計算一個字串的 crc32 多項式
  • crypt — 單向字串散列
  • echo — 輸出一個或多個字串
  • explode — 使用一個字串分割另一個字串
  • fprintf — 將格式化後的字串寫入到流
  • get_html_translation_table — 返回使用 htmlspecialchars 和 htmlentities 後的轉換表
  • hebrev — 將邏輯順序希伯來文(logical-Hebrew)轉換為視覺順序希伯來文(visual-Hebrew)
  • hebrevc — 將邏輯順序希伯來文(logical-Hebrew)轉換為視覺順序希伯來文(visual-Hebrew),並且轉換分行符號
  • hex2bin — 轉換十六進位字串為二進位字串
  • html_entity_decode — Convert all HTML entities to their applicable characters
  • htmlentities — Convert all applicable characters to HTML entities
  • htmlspecialchars_decode — 將特殊的 HTML 實體轉換回一般字元
  • htmlspecialchars — Convert special characters to HTML entities
  • implode — 將一個一維數組的值轉化為字串
  • join — 別名 implode
  • lcfirst — 使一個字串的第一個字元小寫
  • levenshtein — 計算兩個字串之間的編輯距離
  • localeconv — Get numeric formatting information
  • ltrim — 刪除字串開頭的空白字元(或其他字元)
  • md5_file — 計算指定檔案的 MD5 散列值
  • md5 — 計算字串的 MD5 散列值
  • metaphone — Calculate the metaphone key of a string
  • money_format — Formats a number as a currency string
  • nl_langinfo — Query language and locale information
  • nl2br — 在字串所有新行之前插入 HTML 換行標記
  • number_format — 以千位分隔字元方式格式化一個數字
  • ord — 返回字元的 ASCII 碼值
  • parse_str — 將字串解析成多個變數
  • print — 輸出字串
  • printf — 輸出格式化字串
  • quoted_printable_decode — Convert a quoted-printable string to an 8 bit string
  • quoted_printable_encode — Convert a 8 bit string to a quoted-printable string
  • quotemeta — Quote meta characters
  • rtrim — 刪除字串末端的空白字元(或者其他字元)
  • setlocale — Set locale information
  • sha1_file — 計算檔案的 sha1 散列值
  • sha1 — 計算字串的 sha1 散列值
  • similar_text — 計算兩個字串的相似性
  • soundex — Calculate the soundex key of a string
  • sprintf — Return a formatted string
  • sscanf — 根據指定格式解析輸入的字元
  • str_getcsv — 解析 CSV 字串為一個數組
  • str_ireplace — str_replace 的忽略大小寫版本
  • str_pad — 使用另一個字串填充字串為指定長度
  • str_repeat — 重複一個字串
  • str_replace — 子字串替換
  • str_rot13 — 對字串執行 ROT13 轉換
  • str_shuffle — 隨機打亂一個字串
  • str_split — 將字串轉換為數組
  • str_word_count — 返回字串中單詞的使用方式
  • strcasecmp — 二進位安全比較字串(不區分大小寫)
  • strchr — 別名 strstr
  • strcmp — 二進位安全字串比較
  • strcoll — 基於地區設定的字串比較
  • strcspn — 擷取不匹配遮罩的起始子字串的長度
  • strip_tags — 從字串中去除 HTML 和 PHP 標記
  • stripcslashes — 反引用一個使用 addcslashes 轉義的字串
  • stripos — 尋找字串首次出現的位置(不區分大小寫)
  • stripslashes — 反引用一個引用字串
  • stristr — strstr 函數的忽略大小寫版本
  • strlen — 擷取字串長度
  • strnatcasecmp — 使用“自然順序”演算法比較字串(不區分大小寫)
  • strnatcmp — 使用自然排序演算法比較字串
  • strncasecmp — 二進位安全比較字串開頭的若干個字元(不區分大小寫)
  • strncmp — 二進位安全比較字串開頭的若干個字元
  • strpbrk — 在字串中尋找一組字元的任何一個字元
  • strpos — 尋找字串首次出現的位置
  • strrchr — 尋找指定字元在字串中的最後一次出現
  • strrev — 反轉字串
  • strripos — 計算指定字串在目標字串中最後一次出現的位置(不區分大小寫)
  • strrpos — 計算指定字串在目標字串中最後一次出現的位置
  • strspn — 計算字串中全部字元都存在於指定字元集合中的第一段子串的長度。
  • strstr — 尋找字串的首次出現
  • strtok — 標記分割字串
  • strtolower — 將字串轉化為小寫
  • strtoupper — 將字串轉化為大寫
  • strtr — 轉換指定字元
  • substr_compare — 二進位安全比較字串(從位移位置比較指定長度)
  • substr_count — 計算字串出現的次數
  • substr_replace — 替換字串的子串
  • substr — 返回字串的子串
  • trim — 去除字串首尾處的空白字元(或者其他字元)
  • ucfirst — 將字串的首字母轉換為大寫
  • ucwords — 將字串中每個單詞的首字母轉換為大寫
  • vfprintf — 將格式化字串寫入流
  • vprintf — 輸出格式化字串
  • vsprintf — 返回格式化字串
  • wordwrap — 打斷字串為指定數量的字串
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.