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

Related Topics

PHP Forms

PHP form is used to take input from users, by using superglobals$_REQUEST, $_GET and $_POSTmethod. There are various request methods in PHP Get method Post method Put method Patch method Delete...

5 minutes read.

PHP Example

We can create a simple program by writing the source code inside the php tag and save it with .php extension. Syntax: <?php // your code here ?> Let us take an example of PHP. <!DOCTYPE html> <html> <head>            ...

1 minute read.

PHP quotemeta() Function

PHP quotemeta() Function The quotemeta() function in PHP quotes the meta characters and returns a string with a backslash character (\) before some predefine characters. The predefined characters are as follows: period ...

1 minute read.

PHP current() function

PHP current() function The current() function in PHP returns the current element in an array, which is initialized to the first element inserted into the array. Syntax current ( array $array )   Parameter array (required)– This parameter represents the input array or countable object. Return This...

1 minute read.

PHP var_dump() Function

PHP var_dump() Function The var_dump() function in PHP is used to dump the information about a variable. It displays the structured information (arrays and objects) about one or more expressions. This function is also effective...

1 minute read.

PHP is_object() Function

The is_ object() function in PHP finds whether the specified variable is an object or not. It returns a Boolean value TRUE if the specified var is an object else it returns FALSE. Syntax is_object(mixed$var) var(required)- This parameter represents the...

1 minute read.

PHP array_map() Function

PHP array_map() Function The array_map() function  in PHP is used to return an array containing the results of applying the user-defined callback function over the elements of one or more arrays. Syntax array_map ( callable $callback , array $array1 [, array $... ] )  Parameter callable(required)- This parameter...

1 minute read.

PHP levenshtein() Function

PHP levenshtein() Function The levenshtein() function in PHP calculates the Levenshtein distance between two strings. Syntax levenshtein ( string $str1 , string $str2 , int $cost_ins , int $cost_rep , int $cost_del )  Parameter str1(required)- This parameter signifies one of the strings being evaluated for Levenshtein distance. str2(required)- This parameter signifies one of the strings being evaluated...

1 minute read.

PHP array_diff_ukey() Function

The array_diff_ukey() function in PHP compares the keys from array1 against the keys from array2 and returns the difference containing all the entries from array1 that are not present in any of the other arrays. Syntax array_diff_ukey ( array $array1 , array $array2 [, array $... ], callable $key_compare_func ) Parameter array1(required)- This parameter signifies the...

1 minute read.

PHP array_intersect_assoc() function

PHP array_intersect_assoc() function The array_intersect_assoc() function in PHP is used to compute the intersection of arrays with the help of an additional index check. It returns an array containing all the entries from array1 that are present...

1 minute read.

PHP For Loops

PHP for loop is used when the specified condition is predefined. Syntax: for (initialization; condition; increment/decrement ) { code to be executed; } Example <!DOCTYPE html> <html> <head> <title>PHP Tutorial</title> </head> <body> <?php echo " Print counting using for loop"."<br>"; for($i=1;$i<=5;$i++){ echo $i."<br>"; } ?> </body> </html> Output Print counting using...

1 minute read.

PHP strval() function

PHP strval() function The strval() function in PHP is used to get the string value for the specified variable. This function cannot be used on arrays or objects, if applied then would return only the...

1 minute read.

PHP array_pad() Function

PHP array_pad() Function The array_pad() function in PHP pads the array to the given length and value and returns a copy of the array padded to size and value specified by size and value parameter. The padding takes place as...

1 minute read.

PHP Do While Loop

PHP do while loop is used to execute the code at least one time because condition is checked after executing the code. Syntax: do{ //code to be executed  }while(condition); Output <?php $n=1;  do{ echo "$n<br/>";  $n++;  }while($n<=5);  ?> Output 1 2 3 4 5 ← Prev Next →...

1 minute read.

PHP unserialize() Function

PHP unserialize() Function The unserialize() function in PHP takes a single serialized variable and converts it back into a PHP value. Syntax unserialize ( string $str [, array $options ] ) Parameter value(required)- This parameter represents the serialized string. options(optional)- This parameter signifies any options to be...

1 minute read.

PHP array_intersect_ukey() function

The array_intersect_ukey () function in PHP is used to compute the intersection of arrays with the help of a callable function on the keys for comparison. It returns an array containing all the...

1 minute read.

PHP is_null() Function

The is_null() function in PHP is used to  find whether the specified variable is a null or not. It returns a Boolean value true if the parameter var is null else it returns...

1 minute read.

PHP strtok() Function

PHP strtok() Function The strtok() function in PHP splits a string into smaller strings or tokenize the specified string.  Syntax strtok ( string $str , string $token ) Parameter str(required)- This parameter represents the input string to split into smaller strings or tokens. token(required)- It signifies...

1 minute read.

PHP uasort() Function

PHP uasort() Function The uasort() function in PHP sorts an array with a user-defined comparison function and maintains the index association. Syntax uasort ( array &$array , callable $value_compare_func ) Parameter array(required)- This parameter represents the input array. value_compare_func(required)- This parameter represents a string that describe a...

1 minute read.

PHP substr_compare() Function

PHP substr_compare() Function The substr_compare() function in PHP compares two strings from a specified start position. It is a binary-safe and optionally case-sensitive function. Syntax substr_compare ( string $main_str , string $str , int $offset [, int $length [, bool$case_insensitivity]] )  Parameter main_str(required)- This parameter specifies the first string to compare. str(required)- This parameter...

1 minute read.