PHP convert_uuencode() Function

PHP convert_uuencode() Function

The convert_uuencode() function in PHP is used to encode a string and returns the uuencoded data.

Syntax

convert_uuencode ( string $data )

Parameter

data(required)- This parameter represents the data to be encoded.

Return

This function returns the uuencoded data or FALSE on failure.

Example 1

<?php
// initializing the string
$str = "Hello World ! ";
echo "Original String: ".$str;
//after encoding the string
echo "After using the convert_uuencode() function..." 
echo "\nNew String: ".convert_uuencode($str);
?> 

Output

Original String: Hello World ! 
New String: .2&5L;&\@5V]R;&0@(2``

Example 2

<?php
 // initializing the string
 $str = "Tutorial and Example ";
 echo "Original String: ".$str;
 echo "\nAfter convert_uuencode() function...";
 //encoding the string
 echo "\nNew String: ".convert_uuencode($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
// Decode the string  
$str1 ="55V5L8V]M92!T;R!02%`@5V]R;&0A";  
echo "Encoded string:".$str1;  
echo "\nAfter using the 'convert_uudecode()' function... ";
$EncodedStr = convert_uudecode($str1);  
echo "\nNew String:".$EncodedStr . "\n\n";  
//encode the string  
$str2 = "Welcome to PHP World!";  
echo "Decoded string:".$str2;  
echo "\nAfter using 'convert_uuencode()' function..."; 
$dencodeStr = convert_uuencode($str2);  
echo "\nNew String: ".$dencodeStr;  
?>   

Output

Encoded string:55V5L8V]M92!T;R!02%`@5V]R;&0A
After using the 'convert_uudecode()' function... 
New String:Welcome to PHP World!
Decoded string:Welcome to PHP World!
After using 'convert_uuencode()' function...
New String: 55V5L8V]M92!T;R!02%`@5V]R;&0A 

Example 4

<?php
// initializing the string
$str = "766&&@#sg' ";
echo "Original String: ".$str;
echo "\nAfter convert_uuencode() function...";
//encoding the string
echo "\nNew String: ".convert_uuencode($str);
?> 

Output

Original String: 766&&@#sg' 
After convert_uuencode() function...
New String: +-S8V)B9`(W-G)R`` 

Related Topics

PHP array_udiff_assoc() Function

PHP array_udiff_assoc() Function The array_udiff_assoc () function in PHP computes the difference between the specified arrays with additional index check and compares the data by a callback function. It returns all the values from array1 that are not...

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 sort() Function

PHP sort() Function The sort() function in PHP sorts an array where the elements will be arranged from lowest to highest. Syntax sort ( array &$array [, int $sort_flags = SORT_REGULAR ] )  Parameter array(required)- This parameter represents the input array. sort_flags (optional)- This parameter is used to modify the...

1 minute read.

PHP str_rot13() Function

PHP str_rot13() Function The str_rot13() function in PHP performs the ROT13 encoding on a string and returns the resulting string. The ROT13 encoding is used to shift every letter by 13 places in the alphabet...

1 minute read.

PHP is_numeric() Function

The is_numeric() function in PHP finds whether the specified variable is a number or a numeric string. It returns a Boolean value TRUE if the specified var is a number or a numeric string else it returns FALSE otherwise. Syntax is_numeric ( mixed...

1 minute read.

PHP parse_str() Function

PHP parse_str() Function The parse_str() function in PHP parses a query string into variables. Syntax parse_str ( string $encoded_string [, array &$result ] ) Parameter encoded_string(required)- This parameter represents the input string. result(optional)- This parameter specifies the name of an...

1 minute read.

PHP vfprintf() Function

PHP vfprintf() Function The vfprintf() function in PHP writes a formatted string to a specified output stream. Syntax vfprintf ( resource $handle , string $format , array $args )  Parameter handle(required)- This parameter represents where to write the string. format(required)- This parameter specifies the string and how to format the...

3 minutes read.

PHP array_chunk() Function

PHP array_chunk() Function The array_chunk() function in PHP is used to split an array into chunks where the last chunk may contain less than size elements. Syntax array_chunk ( array $array , int $size [, bool $preserve_keys ]...

1 minute read.

PHP strcasecmp() Function

PHP strcasecmp() Function The strcasecmp() function in PHP compares two strings. It is a binary-safe case-insensitive string function. Syntax strcasecmp ( string $str1 , string $str2 ) Parameter str1(required)- This parameter represents the first string. str2(required)- This parameter represents the second string. Return This function returns a value less than( <...

1 minute read.

PHP array_unshift() Function

PHP array_unshift() Function The array_unshift () function in PHP prepends one or more elements to the beginning or front of an array. It returns the new number of elements in the array. Syntax array_unshift ( array &$array [, mixed $... ] ) Parameter array(required)- This array represents...

1 minute read.

PHP array_uintersect_assoc() Function

PHP array_uintersect_assoc() Function The array_uintersect_uassoc() function in PHP calculates the intersection of arrays by comparing the data and indexes by separate callback functions. It returns an array containing all the values of the first input...

2 minutes read.

PHP array_key_exists() function

The array_key_exists () function in PHP is used to check whether the specified key exists in the array or not. It returns a Boolean value TRUE if the given key exists else it returns FALSE. Syntax array_key_exists(mixed key,array$array) Parameter key(required)- This...

1 minute read.

PHP join() Function

PHP join() Function The join() function of PHP returns a string from the elements of an array. This function is an alias of the implode() function. Syntax join(separator,array) Parameter separator(Optional)- Specifies what to put between the array elements. The default...

1 minute read.

WordPress Plugin

WordPress Plugin is a process used to add or extend the functionality which can be enabled or disabled, and it does not interfere with the software and its code. WordPress is lightweight and smooth...

2 minutes read.

PHP Environment Setup

To install PHP, We have to installed AMP(Apache, MySQL and PHP) software. There are various AMP software available in the market. XAMPP (Cross-Platform, Apache, MySQL, PHP and Perl) for windows. ...

2 minutes read.

PHP strrrev() Function

PHP strrrev () Function The strrev() function in PHP reverses a string. Syntax strrev ( string $string ) Parameter string(required)- This parameter represents the input string to be reversed. Return This function returns the reversed string. Example 1 Output Initial string: Hello...

1 minute read.

PHP htmlspecialchars_decode() Function

PHP htmlspecialchars_decode() Function The htmlspecialchars_decode() function in PHP convert some predefined HTML entities to characters. The some predefined HTML entities that will be decoded are as follows: &amp; OR & (ampersand)&quot; OR " (double quote)&#039;...

2 minutes read.

PHP htmlentities() Function

PHP htmlentities() Function The htmlentities() function in PHP converts all characters to HTML entities. Syntax htmlentities(string,flags,character-set,double_encode);   Parameter string(required)- This parameter specifies the string to convert. flags(optional)- This parameter specifies how to handle quotes, invalid encoding and the used document type. The...

1 minute read.

PHP similar_text() Function

PHP similar_text() Function The similar_text() function in PHP calculates the similarity between two strings. Syntax similar_text ( string $first , string $second [, float &$percent ] ) Parameter first(required): This parameter represents the first string to be compared. second(required): This parameter represents the second string to be compared. percent(optional): This...

1 minute read.

PHP array_diff_assoc() Function

PHP array_diff_assoc() Function The array_diff_assoc() Function in PHP compares the difference of arrays and returns an array containing all the values from array1 that are not present in any of the other arrays. Syntax array_diff_assoc ( array $array1 , array $array2 [, array $... ] ) Parameter array1(required)- This parameter signifies...

1 minute read.