PHP convert_uuencode() 函数
PHP convert_uuencode() 函数是预定义的字符串函数,用于使用 uuencode 算法对字符串进行编码。它返回编码后的数据。
注意:使用 uuencode 函数后,编码数据的大小比原始数据大35%。
语法
convert_uuencode(string)
Parameter | Description | Required/Optional |
---|---|---|
String | The string to uuencode | Required |
示例1
<?php
// encode the string
str2 = "I love My India";
echo "Your Decoded string is :".str2;
uuencodeString ="<br>"."By using 'convert_uuencode()' function your encoded string is : ". convert_uuencode(str2);
echo $uuencodeString . "<br>";
?>
输出:
Your Decoded string is :I love My India
By using 'convert_uuencode()' function your encoded string is : /22!L;W9E(UY(EN9&EA `
示例2
<?php
// encode the string
str2 = "I love PHP!";
echo "Your Decoded string is :".str2;
uuencodeString ="<br>"."By using 'convert_uuencode()' function your encoded string is : ". convert_uuencode(str2);
echo uuencodeString . "<br>"."<br>";
// Decode the stringstr1 =("+22!L;W9E(%!(4\"`\n`");
echo "Your Encoded string is :".str1;
EncodedString ="<br>"."By using 'convert_uudecode()' function your encoded string is : ". convert_uudecode(str1);
echo $EncodedString . "<br>"."<br>";
?>
输出:
Your Decoded string is :I love PHP!
By using 'convert_uuencode()' function your encoded string is : +22!L;W9E(%!(4"` `
Your Encoded string is :+22!L;W9E(%!(4"` `
By using 'convert_uudecode()' function your encoded string is : I love PHP!