PHP convert_cyr_string() Function

PHP chunk_split() Function
PHP convert_uudecode() Function

In this article, you will learn about converting one Cyrillic character set to another using convert_cyr_string() function. Before learning about this function, you must know about the CYR character set. The Cyrillic characters set consist of the following character sets.

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

The convert_cyr_string() convert Cyrillic character-set to another.

What is the syntax of the CONVERT_CYR_STRING() function in PHP?

convert_cyr_string(string,from,to)
ParameterDescription
stringThe string to convert from one Cyrillic char set to other – Required
fromCyrillic character-set to convert from – Required
toCyrillic character-set to convert to – Required
PHP convert_cyr_string() method

examples of the convert_CYR_String method

Example 1. In this example, we takes a string and pass it to the convert_cyr_string() and the result was the converted Cyrillic character-set.

<?php
$str = "Hello PHP.org! æøå";
echo convert_cyr_string($str,'w','a');
?>

PHP chunk_split() Function
PHP convert_uudecode() Function
en English
X
Scroll to Top