PHP convert_cyr_string()関数
例
文字列をある文字セットから別の文字セットに変換します。
<?php
$str = "Hello world! æøå";
echo $str . "<br>";
echo convert_cyr_string($str,'w','a');
?>
定義と使用法
convert_cyr_string()関数は、文字列をあるキリル文字セットから別の文字セットに変換します。
サポートされているキリル文字セットは次のとおりです。
- k-koi8-r
- w-windows-1251
- 私 - iso8859-5
- a - x-cp866
- d-x-cp866
- m - x-mac-キリル文字
注:この関数はバイナリセーフです。
構文
<div> convert_cyr_string(<em>string,from,to</em>)</div>
パラメータ値
|
パラメータ |
説明 |
|---|---|
| string | Required 変換する文字列 |
| from | Required どのキリル文字セットから変換するかを指定する文字。 |
| to | Required 変換するキリル文字セットを指定する文字。 |
Technical Details
| Return Value: | 変換された文字列を返します |
|---|---|
|
PHP バージョン: |
4+ |