What is PHP convert_uudecode() Function?
If you want to decode a uuencoded string, use convert_uudecode() function.
Why you use PHP convert_uudecode() Function?
Some systems like old email systems, text-only storage, logs files or plain-text files cannot handle raw binary data properly. So, you need to encode it into text so that you can safely transmit or store the data. For this reason, we need php convert_uuencode() function.
Syntax:
convert_uudecode(string)
Parameters:
The Function has 1 parameter which is required-
string (Required): it specifies the string that is uuencoded data.
Return Values:
It returns the decoded binary data.
Examples:
Example:
<?php
$string = "Learn PHP";
echo "Main string: $string";
echo "<br />";
$encoded = convert_uuencode($string);
echo "After uuencoding: " . $encoded . "<br /><br />";
echo "After uudecoding: " . convert_uudecode($encoded);
?>
Output:
Main string: Learn PHP
After uuencoding: )3&5A
After uudecoding: Learn PHP
Notes on convert_uudecode() Function:
A complete uudecode file requires begin or end line. The convert_uuencode() function doesn’t create this. And, the convert_uudecode() function doesn’t accept the begin and the end line too.
Opposite of PHP convert_uudecode() Function:
The opposite of convert_uudecode() function is PHP convert_uuencode() function.
PHP Version Support:
PHP 5, PHP 7, PHP 8
Summary: PHP convert_uudecode() Function
convert_uudecode() function is one of the built-in string functions. Use this function to decode a uuencoded string into original binary data.