“Func string convert cyr string”的版本间差异

本页内容
(创建页面,内容为“{{DISPLAYTITLE:convert_cyr_string()}}7 = PHP convert_cyr_string() 函数 = PHP String 参考手册 把字符串由一种字符集转换成另一种: <sample title="" desc="" lang="php" hererun="1">example_start <?php $str = "Hello world! æøå"; echo $str . "<br>"; echo convert_cyr_string($str,'w','a'); ?> example_end</sample> == 定义和用法 == convert_cyr_string() 函数把字符串由一种 Cyrill…”)
 
Neo讨论 | 贡献
(文本替换 - 替换“Category:php ref string”为“Category:PHP字符串函数参考手册”)
 
第1行: 第1行:
{{DISPLAYTITLE:convert_cyr_string()}}[[分类:PHP字符串函数参考手册|7]]
{{DISPLAYTITLE:convert_cyr_string()}}[[Category:PHP字符串函数参考手册|7]]
= PHP convert_cyr_string() 函数 =
= PHP convert_cyr_string() 函数 =



2022年8月26日 (五) 10:10的最新版本

PHP convert_cyr_string() 函数

分类:PHP字符串函数参考手册

把字符串由一种字符集转换成另一种:


示例

<?php

$str = "Hello world! æøå";

echo $str . "<br>";

echo convert_cyr_string($str,'w','a');

?>

定义和用法

convert_cyr_string() 函数把字符串由一种 Cyrillic 字符集转换成另一种。

被支持的 Cyrillic 字符集是:

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

注释:该函数是二进制安全的。

语法


convert_cyr_string(string,from,to)

参数 描述
string 必需。规定要转换的字符串。
from 必需。一个规定了源 Cyrillic 字符集的字符。
to 必需。一个规定了目标 Cyrillic 字符集的字符。

技术细节

返回值: 返回已转换的字符串。
PHP 版本: 4+

分类:PHP字符串函数参考手册

此页面最后编辑于2022年8月26日 (星期五) 10:10。