当前位置: 首页> 函数类别大全> 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 字符集的字符。
同类函数
  • 基于区域设置的字符串比较 strcoll

    strcoll

    基于区域设置的字符串比较
  • 将二进制数据转换为十六进制表示 bin2hex

    bin2hex

    将二进制数据转换为十六进制表示
  • 返回有关字符串中使用的字符的信息-统计 string 中每个字节值(0..255)出现的次数 count_chars

    count_chars

    返回有关字符串中使用的字符的信息-统计s
  • 使用 uuencode 编码一个字符串 convert_uuencode

    convert_uuencode

    使用uuencode编码一个字符串
  • 计算一个字符串的 crc32 多项式 crc32

    crc32

    计算一个字符串的crc32多项式
  • 解码一个 uuencode 编码的字符串 convert_uudecode

    convert_uudecode

    解码一个uuencode编码的字符串
  • 返回使用 htmlspecialchars() 和 htmlentities() 后的转换表 get_html_translation_table

    get_html_translation_table

    返回使用htmlspecialchars
  • 检查字符串是否以给定的子字符串开头 str_starts_with

    str_starts_with

    检查字符串是否以给定的子字符串开头
热门文章