PHP convert_uudecode() Function
The PHP convert_uudecode() function decodes a uuencoded string. This function is often used together with the convert_uuencode() function.
Syntax
convert_uudecode(string)
Parameters
string |
Required. Specify the uuencoded data. |
Return Value
Returns the decoded data as a string or false on failure.
Example:
The example below shows the usage of convert_uudecode() function.
<?php $str = "24')O9W)A;6UI;F<@:7,@9G5N`"; $uudecode_str = convert_uudecode($str); echo "The string is: $str \n"; echo "Decoded string is: $uudecode_str \n"; ?>
The output of the above code will be:
The string is: 24')O9W)A;6UI;F<@:7,@9G5N` Decoded string is: Programming is fun
Example:
Consider one more example which shows how a string is encoded and decoded.
<?php $str1 = "Programming is fun"; $uuencode_str1 = convert_uuencode($str1); echo "The string is: $str1 \n"; echo "Encoded string is: $uuencode_str1 \n"; $str2 = "24')O9W)A;6UI;F<@:7,@9G5N`"; $uudecode_str2 = convert_uudecode($str2); echo "The string is: $str2 \n"; echo "Decoded string is: $uudecode_str2 \n"; ?>
The output of the above code will be:
The string is: Programming is fun Encoded string is: 24')O9W)A;6UI;F<@:7,@9G5N` The string is: 24')O9W)A;6UI;F<@:7,@9G5N` Decoded string is: Programming is fun
❮ PHP String Reference