PHP convert_uuencode() Function
Definition
The convert_uuencode() function encodes a string using the uuencode algorithm.
Syntax
PHP convert_uuencode() Function has the following syntax.
convert_uuencode(string)
Parameter
Parameter | Is Required | Description |
---|---|---|
string | Required. | The string to uuencode |
Return
PHP convert_uuencode() Function returns the uuencoded data.
Example
Encode a string:
<?php
$str = "Hello world from java2s.com!";
echo convert_uuencode($str);
?>
The code above generates the following result.
Example 2
Encode a string and then decode it:
<?php// w w w .j a v a 2s . 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.