In this article, you will learn how to decodes an encoded string. This is not an ordinary encoding and decoding. Observe the syntax of the function, its uuencoding and uudecoding with which we are dealing.
The PHP convert_uudecode() method decodes a string that is uuencoded.
convert_uudecode(string)
Parameters | Details |
---|---|
string | The string to decode – must be uuencoded string |
Examples of the convert_uudecode() function
Example 1. In this example, we simply uuencode the given string.
<?php
$str = ",2&5L;&\@=V]R;&0A `";
echo convert_uudecode($str);
?>
Example 2. In this example, we encode a string using convert_uuencode method and then decode is using convert_uudecode method.
<?php
$str = "Hello world!";
// Encode the string
$encodeString = convert_uuencode($str);
echo $encodeString . "<br>";
// Decode the string
$decodeString = convert_uudecode($encodeString);
echo $decodeString;
?>