PHP convert_uuencode()Functions
Examples
Encode a string:
<?php
$str = "Hello world!";
echo convert_uuencode($str);
?>
$str = "Hello world!";
echo convert_uuencode($str);
?>
Run example »
Definition and Usage
The convert_uuencode() function encodes a string using the uuencode algorithm.
Note:This function encodes all strings (including binary) into printable characters, ensuring their safe storage in databases and transmission over networks. Remember, before using the data again, use theconvert_uudecode()function.
Note:uuencoded data is about 35% larger than the original data.
Syntax
convert_uuencode(string)
| Parameters | Description |
|---|---|
| string | Required. Specifies the string to be uuencode encoded. |
Technical Details
| Return value: | Returns the uuencoded data. |
|---|---|
| PHP Version: | 5+ |
More Examples
Example 1
Encode a string, 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;
?>
$str = "Hello world!";
// Encode the string
$encodeString = convert_uuencode($str);
echo $encodeString . "<br>";
// Decode the string
$decodeString = convert_uudecode($encodeString);
echo $decodeString;
?>
Run example »
PHP String Reference Manual Other Extensions