Encoded string:
<?php$str = "Hello world!";echo convert_uuencode($str);?>The convert_uuencode() function uses the uuencode algorithm to encode a string.
Note: This function encodes all strings (including binary) into printable characters to ensure the security of database storage and network transmission. Remember to use the convert_uudecode() function before reusing the data.
Note: uuencoded data is approximately 35% larger than the original data.
convert_uuencode( string )
parameter | describe |
---|---|
string | Required. Specifies the string to be uuencoded. |
Return value: | Returns uuencoded encoded data. |
---|---|
PHP version: | 5+ |
Encode the string and then decode it:
<?php$str = "Hello world!";// Encode the string$encodeString = convert_uuencode($str);echo $encodeString . "<br>";// Decode the string$decodeString = convert_uudecode($encodeString); echo $decodeString;?>