PHP 中的 convert_cyr_string() 函数
convert_cyr_string() 函数用于在一个西里尔字符集和另一个西里尔字符集之间进行转换。
受支持的西里尔字符集包括:
k - koi8-r
w - windows-1251
i - iso8859-5
a - x-cp866
d - x-cp866
m - x-mac-cyrillic
语法
convert_cyr_string(str, from, to)
参数
str - 要格式化的字符串
from - 字符串中源西里尔字符集,用单个字符表示。
to - 字符串中目标西里尔字符集,用单个字符表示。
返回
convert_cyr_string() 函数返回一个转换后的字符串。
以下示例演示了该函数:
示例
<?php $s = "Welcome to the website! æøå"; echo $s . "<br>"; echo convert_cyr_string($str,'w','a'); ?>
以下是输出结果:
输出
Welcome to the website! æøå Welcome to the website! ¦è¥
广告
数据结构
网络化
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP