首頁  >  文章  >  後端開發  >  PHP字串處理函數大全

PHP字串處理函數大全

WBOY
WBOY原創
2016-07-25 09:12:39745瀏覽
  • 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 — 打斷字串為指定數量的字串


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn