PHP convert_cyr_string() 函数
说明
convert_cyr_string() 函数将字符串从一个西里尔字符集 转换为另一个。
下表总结了该函数的技术细节。
| 返回值: | 返回转换后的字符串。 |
|---|---|
| 版本: | PHP 4+ |
语法
convert_cyr_string() 函数的基本语法如下:
convert_cyr_string(string, from, to);
以下示例显示了 convert_cyr_string() 函数的运行情况。
<?php
// 示例字符串
$str = "Hello world! æøå";
// 显示转换后的字符串
echo convert_cyr_string($str, 'w', 'a');
?>
参数
convert_cyr_string() 函数接受以下参数。
| 参数 | 说明 | |
|---|---|---|
| Required — 以下参数是必需的 | ||
| string | 指定要转换的字符串。 | |
| from | 将源西里尔字符集指定为单个字符 | |
| to | 将目标西里尔字符集指定为单个字符。 | |
Advertisements
