convert_uuencode – PHP Functions

Syntax:

string convert_uuencode(string) ;

Description :

convert_uuencode() function will encodes a string using the uuencode algorithm.

Note : Uuencode translates all strings (including binary’s ones) into printable characters, making them safe for network transmissions.
Note : Uuencoded data is about 35% larger than the original.

Parameter :

  • string –  String to be encoded.

Output :

This will return the encoded string using the uuencode algorithm or FALSE on failure.


Related articles : convert_uudecode().


convert_uuencode() – PHP Functions Example 1 :

$strExample = convert_uuencode("Hi from tutorialmines.net!");
echo $strExample;

In above example ,We have a string “Hi from tutorialmines.net!”. So, when we apply convert_uuencode() function. This will return below values.

Now Output will become –

:2&D@9G)O;2!T=71O 


convert_uuencode() with convert_uudecode()  – PHP Functions Example 2 :

<?php
/**Encode the string**/
$strExample = convert_uuencode("Hi from tutorialmines.net!");
echo $strExample;
echo "<br><br>";


/**Decode the above string back to its original value**/
$strExample1 = convert_uudecode($strExample);
echo $strExample1;
?>

In above example ,We have a string “Hi from tutorialmines.net!”. So, when we apply convert_uuencode() and convert_uudecode() function, We will get the original value.

Output will be like below:

:2&D@9G)O;2!T=71O
Hi from tutorialmines.net!


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *