當前位置: 首頁> 函數類別大全> 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 字符集的字符。
同類函數
  • 將所有適用的字符轉換為HTML實體-將字符轉換為HTML 轉義字符 htmlentities

    htmlentities

    將所有適用的字符轉換為HTML實體-將字
  • 將一個一維數組的值轉化為字符串 implode

    implode

    將一個一維數組的值轉化為字符串
  • 返回格式化的字符串 sprintf

    sprintf

    返回格式化的字符串
  • 根據指定格式解析輸入的字符 sscanf

    sscanf

    根據指定格式解析輸入的字符
  • 設置區域設置信息 setlocale

    setlocale

    設置區域設置信息
  • 返回使用htmlspecialchars() 和htmlentities() 後的轉換錶 get_html_translation_table

    get_html_translation_table

    返回使用htmlspecialchars
  • 判斷一個字符串中是否包含一個給定的子字符串 str_contains

    str_contains

    判斷一個字符串中是否包含一個給定的子字符
  • implode的別名 join

    join

    implode的別名
熱門文章