The convert_cyr_string() function converts a string from one Cyrillic character-set to another.
PHP convert_cyr_string() function has the following syntax.
convert_cyr_string(string,from,to)
Parameter | Is Required | Description |
---|---|---|
string | Required. | The string to convert |
from | Required. | A character that specifies what Cyrillic character-set to convert from |
to | Required. | A character that specifies what Cyrillic character-set to convert to |
The supported Cyrillic character-sets are:
This function is binary-safe.
PHP convert_cyr_string() Function returns the converted string.
Convert a string from one character-set to another:
<?php
$str = "Hello world from java2s.com!";
echo $str . "\n";
echo convert_cyr_string($str,'w','a');
?>
The code above generates the following result.