convert_cyr_string – PHP String Functions
Syntax :
Description :
convert_cyr_string() function will converts a string from one Cyrillic character set to another.
Parameter :
- string – This is Required parameter. This is string which needs to be converted.
- from – This is Required parameter. A character which specifies from which Cyrillic character-set to convert from.
- to – This is Required parameter. A character which specifies in which Cyrillic character set to convert it.
Supported characters are:
- k – koi8-r
- w – windows-1251
- i – iso8859-5
- a – x-cp866
- d – x-cp866
- m – x-mac-cyrillic
Output :
This will return the converted string.
convert_cyr_string() – PHP Functions Example 1 :
<?php $strExample = 'Hello from Tutorialmines !!'; echo $strExample.'<br>'; echo convert_cyr_string($strExample, 'w', 'k'); ?>
In above example ,We have a string. Now this function will convert this string from windows-1251 to koi8-r. Below will be the output of above example.
Hello from Tutorialmines !!