PHP convert_cyr_string() 函数

PHP 教程 · 2019-01-29 11:11:23

实例

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

<?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 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Clever Algorithms

Clever Algorithms

Jason Brownlee / lulu.com / 2012-6-15 / USD 37.99

Download : http://www.lulu.com/product/file-download/clever-algorithms-nature-inspired-programming-recipes/14696557 Read free on line:http://www.cleveralgorithms.com/nature-inspired/index.html T......一起来看看 《Clever Algorithms》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码