Introduction
In this article I describe the PHP string functions convert_cyr_string, convert_uudecode and convert_uuencode. To learn some other math functions, go to:
- String Functions in PHP: Part1
- String Functions in PHP:Part2
PHP convert_cyr_string() Function
The PHP convert_cyr_string function converts a string from one Cyrillic character set to another and returns a converted string.
The supported characters sets are:
- k - koi8-r
- w - windows-1251
- i - iso8859-5
- a - x-cp866
- d - x-cp866
- m - x-mac-cyrillic
Syntax
convert_cyr_string(string, from,to) |
Parameters of the convert_cyr_string Function
The parameters of the convert_cyr_string function are:
Parameter |
Description |
string |
It specifies the string to convert. |
length |
It specifies Cyrillic character set, as a single character. |
to |
It specifies what Cyrillic character-set to convert to. |
Example
An example of the convert_cyr_string function is:
<?php
$string = 'Welcome at MCN Solution..';
echo $string.'<br>';
echo convert_cyr_string($string, 'w', 'k');
?>
Output
PHP convert_uudecode() function
The convert_uudecode function is used to decode a uuencoded string.
Syntax
Parameter in convert_uudecode Function
The parameter of the convert_uudecode function is:
Parameter |
Description |
string |
It specifies the uuencoded string to decode. |
Example
An example of the convert_uudecode function is:
<?php
echo convert_uudecode("+22!L;W9E(%!(4\"$`\n`");
?>
Output
PHP convert_uuencode() Function
The convert_uuencode function encodes a string using the uuencode algorithm.
Syntax
Parameter in convert_uuencode Function
The parameter of the convert_uuencode function is:
Parameter |
Description |
string |
It specifies the string to uuencode. |
Example
An example of the convert_uuencode function is:
<?php
echo convert_uuencode("Vinod");
?>
Output