當前位置: 首頁> 函數類別大全> convert_cyr_string

convert_cyr_string

將字符由一種Cyrillic 字符轉換成另一種
名稱:convert_cyr_string
分類:字符串
所屬語言:php
一句話介紹:把字符串由一種Cyrillic 字符集轉換為另一種。

定義和用法

convert_cyr_string()函數把字符串由一種Cyrillic 字符集轉換成另一種。

被支持的Cyrillic 字符集是:

  • k - koi8-r
  • w - windows-1251
  • i - iso8859-5
  • a - x-cp866
  • d - x-cp866
  • m - x-mac-cyrillic

註釋:該函數是二進制安全的。

實例

把字符串由一種字符集轉換成另一種:

 <?php
$str = "Hello world! ???" ;
echo $str . "<br>" ;
echo convert_cyr_string ( $str , 'w' , 'a' ) ;
?>

文法

convert_cyr_string ( string , from , to )
參數 描述
string 必需。規定要轉換的字符串。
from 必需。一個規定了源Cyrillic 字符集的字符。
to 必需。一個規定了目標Cyrillic 字符集的字符。
同類函數
  • 計算字符串的soundex鍵 soundex

    soundex

    計算字符串的soundex鍵
  • 計算子字符串出現次數 substr_count

    substr_count

    計算子字符串出現次數
  • 獲取字符串長度 strlen

    strlen

    獲取字符串長度
  • 輸出格式化的字符串 printf

    printf

    輸出格式化的字符串
  • 將邏輯順序希伯來文(logical-Hebrew)轉換為視覺順序希伯來文(visual-Hebrew) hebrev

    hebrev

    將邏輯順序希伯來文(logical-He
  • 檢查字符串是否以給定的子字符串開頭 str_starts_with

    str_starts_with

    檢查字符串是否以給定的子字符串開頭
  • 轉換十六進製字符串為二進製字符串 hex2bin

    hex2bin

    轉換十六進製字符串為二進製字符串
  • 反轉義一個轉義的字符串 stripslashes

    stripslashes

    反轉義一個轉義的字符串
熱門文章