Phpbase64_decode and base64_encode_PHP tutorial

Source: Internet
Author: User
Phpbase64_decode and base64_encode. Phpbase64_decode and base64_encodebase64_decode (in PHP4, PHP5) base64_decode-the Base64 encoded MIME description string base64_decode (string $ Data [, deploy php base64_decode and base64_encode

Base64_decode
(PHP 4 and PHP 5)

Base64_decode-base64-encoded MIME of the decoded data

Description
String base64_decode (string $ Data [, Boolean $ strict = false])
Decodes BASE64 encoded data.

Parameters

Data
Encoding data.

Strict
Returns FALSE if the input contains a base64 alphabet other than the characters.


Return value
An error occurred while returning the original data or FALSE. The returned data may be binary.

Modify

Version description
Strictly supplemented by 5.2.0


Instance

Example of #1 base64_decode ()

$ Str = 'vghpcybpcybhbiblbmnvzgvkihn0cmluzw = ';
Echo base64_decode ($ str );
?>
The above example will output:

This is an encoded string

Base64_encode
(PHP 4 and PHP 5)

Base64_encode-use MIME-encoded data for Base64

Description
String base64_encode (string $ data)
Encode specific data with Base64.

This encoding is used to make binary data survive and transport through the transport layer does not support 8-bit encoding, such as email organizations.

Base64 encoding requires more than 33% of the space than the original data.

Parameters

Data
The data is encoded.


Return value
Encode the data as a string.

Instance

Example of #1 base64_encode ()

$ Str = 'This is an encoded string ';
Echo base64_encode ($ str );
?>
The above example will output:

VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw =


Http://www.bkjia.com/PHPjc/445458.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445458.htmlTechArticlephp base64_decode with base64_encode base64_decode (PHP 4, PHP 5) base64_decode-decodes the Base64 encoded MIME description string base64_decode (string $ Data [, cloth...

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.