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 Functions

PHP functions are used to reuse piece of code many times.  There are various built-in functions in PHP. A function will be executed by a call to the function. Following are...

3 minutes read.

Multiple-Inheritance in PHP

Multiple-Inheritance in PHP Multiple-Inheritance is the resources of the Object Oriented Programming Languages in which child class or subclass can inherit the resources of the multiple parent classes or superclasses. PHP does...

3 minutes read.

PHP array_multisort() Function

PHP array_multisort () Function The array_multisort() function in PHP sorts multiple or multi-dimensional arrays at once. Syntax array_multisort ( array &$array1 [, mixed $array1_sort_order [, mixed $array1_sort_flags [, mixed $... ]]] ) Parameter array1(required)- This parameter specified the input array to sort. array1_sort_order(optional)- This parameter specifies the order (ascending or descending)...

1 minute read.

PHP rsort() Function

PHP rsort() Function The rsort () function in PHP is used to sort an array in reverse order i.e., highest to lowest. Syntax rsort ( array &$array [, int $sort_flags = SORT_REGULAR ] ) Parameter array(required)- This parameter represents the input array. sort_flags (optional)- This parameter is used to...

1 minute read.

PHP count() function

PHP count() function The count() function in PHP is used to count all elements in the specified array or something in an object. Syntax count ( mixed $array_or_countable [, int $mode = COUNT_NORMAL ] )   Parameter array_or_countable(required)– This parameter represents the input array or countable object. mode(optional)- This...

2 minutes read.

PHP array_fill() function

PHP array_fill() function The array_fill() function in PHP fills an user-defined array with num entries of the value that of specified values parameter, where the keys start at the start_index parameter. Syntax array_fill ( int $start_index , int $num , mixed $value ) Parameter start_index(required)- This parameter represents the first index of the...

1 minute read.

PHP str_ireplace() Function

PHP str_ireplace() Function The PHP str_ireplace() function in PHP replaces some characters with some other characters in a string. Syntax str_ireplace ( mixed $search , mixed  $replace , mixed $subject [, int &$count ] ) Parameter search(required)- This parameter specifies the value being searched for. replace(required)- This parameter represents the replacement value...

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

PHP array_reduce() Function The array_reduce() function in PHP reduces the array to a single value using by applying a callback function to the elements of the array. Syntax array_reduce ( array $array , callable $callback [, mixed $initial = NULL ] ) Parameter array(required)- This parameter represents the input array. callback (required)- This...

1 minute read.

PHP Variables

PHP Variable is the name of memory location used to hold the data.  In PHP, variable starts with $ symbol. Rules for PHP Variables. Variable starts with $ sign. Variable name...

2 minutes read.

PHP array_unique() Function

PHP array_unique() Function The array_unique() function in PHP removes the duplicate values from the specified array. Syntax array_unique (array $array [, int $sort_flags = SORT_STRING]) Parameter array(required)- This array represents the first input array. sort_flags (optional)- This parameter is used to modify the sorting behavior. The...

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

PHP lcfirst() Function The lcfirst() function in PHP converts the first character of a string to lowercase if that character is alphabetic. Syntax lcfirst ( string $str ) Parameter str(required)- This parameter signifies the input string. Return This function returns a string with the...

1 minute read.

PHP array_change_key_case() Function

PHP array_change_key_case() Function The array_change_key_case() function in PHP is used to change the case of all keys present in the specified array. It returns an array with all keys in the specified array to lowercase or...

1 minute read.

PHP For loop with Example

For loop in PHP : The for loop is the most potent loop, it combines the abilities to set up variables as we enter the loop, test for conditions while iterating...

3 minutes read.

PHP str_getcsv() Function

PHP str_getcsv() Function The str_getcsv() function in PHP parses a CSV string into an array and returns an array containing the fields read. Syntax str_getcsv ( string $input [, string $delimiter [, string $enclosure [, string$escape ]]] ) Parameter input(required)- This parameter represents the string to parse. delimiter(optional)- This parameter signifies...

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.

Composer Installation

Composer is an application-level package manager for the PHP Programming language. The development began in April 2011 and it was first released on March 1, 2012. Commands: require install update remove Installation:  Download the installer by visiting...

1 minute read.

PHP in_array() Function

PHP in_array() Function The in_array() function in PHP checks if the value exists in the specified array or not. Syntax in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] )  Parameter needle(required)- This parameter represents the searched value. haystack(required)- This parameter represents the input array. strict(optional)- This parameter...

1 minute read.