PHP convert_uudecode() Function
PHP convert_uudecode() Function
The convert_uudecode() function in PHP decodes a uuencoded string.
Syntax
convert_uudecode ( string $data )
Parameter
data- This parameter represents the uuencoded data.
Return
This function returns the decoded data as a string or FALSE on failure.
Example 1
<?php // initializing the string $str = ",2&5L;&\@=V]R;&0BA "; echo "Original String: ".$str; //decoding the string echo "\nNew String: ".convert_uudecode($str); ?>
Output
Original String: ,2&5L;&\@=V]R;&0BA New String: Hello world"
Example 2
<?php // initializing the string $str = "=5V5L8V]M92!T;R!4=71O<FEA;&%N9$5X86UP;&4`"; echo "Original String: ".$str; echo "\nAfter convert_uudecode() function..."; //decoding the string echo "\nNew String: ".convert_uudecode($str); ?>
Output
Original String: =5V5L8V]M92!T;R!4=71O<FEA;&%N9$5X86UP;&4` After convert_uudecode() function... New String: Welcome to TutorialandExample
Example 3
<?php // initializing the string // passing a string that is not a valid uuencoded string $str = "My name is Reema"; echo "Original String: ".$str; echo "\nAfter convert_uudecode() function..."; //decoding the string echo "\nNew String: ".convert_uudecode($str); // return an error ?>
Output
PHP Warning: convert_uudecode(): The given parameter is not a valid uuencoded string in /workspace/Main.php on line 7