PHP uses the uuencode algorithm to encode a string function Convert_uuencode ()

Source: Internet
Author: User

Instance

Encoded string:

<?php$str = "Hello world!"; echo Convert_uuencode ($STR);? >

Definition and usage

The Convert_uuencode () function encodes a string using the uuencode algorithm.

Note: This function encodes all strings (including binary) as printable characters, ensuring the security of their database storage and network transport. Keep in mind that you use the Convert_uudecode () function before you reuse the data.

Note: The uuencoded data is approximately 35% larger than the original data.

Grammar

Convert_uuencode (String)

Parameter description

string is required. Specifies the string to be uuencode encoded.

Technical details

Return value: Returns the Uuencoded encoded data.

PHP version: 5+

More examples

Example 1

Encode the string, and then decode it:

<?php$str = "Hello world!"; /Encode The string$encodestring = Convert_uuencode ($STR); Echo $encodeString. "<br>";//Decode The string$decodestring = Convert_uudecode ($encodeString); Echo $decodeString;? >

Syntax: Convert_uuencode (String), the code is as follows:

$str = "Hello World";          Defines a string echo $str;            Outputs the original string $result =convert_uuencode ($STR);       Perform uuencode operation Echo $result;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.