The convert_uuencode() function encodes a string using the uuencode algorithm.
PHP convert_uuencode() Function has the following syntax.
convert_uuencode(string)
Parameter | Is Required | Description |
---|---|---|
string | Required. | The string to uuencode |
PHP convert_uuencode() Function returns the uuencoded data.
Encode a string:
<?php
$str = "Hello world from java2s.com!";
echo convert_uuencode($str);
?>
The code above generates the following result.
Encode a string and then decode it:
<?php/* w ww . j av a2 s.c om*/
$str = "Hello world from java2s.com!";
// Encode the string
$encodeString = convert_uuencode($str);
echo $encodeString . "\n";
// Decode the string
$decodeString = convert_uudecode($encodeString);
echo $decodeString;
?>
The code above generates the following result.