php base64_decode 与base64_encode_PHP教程

WBOY
Release: 2016-07-20 11:01:05
Original
4135 people have browsed it

php base64_decode 与base64_encode  

base64_decode
( PHP 4中, PHP 5中)

base64_decode -解码数据的Base64编码的MIME

描述
字符串base64_decode (字符串$数据[ ,布尔$严格=虚假] )
解码一BASE64编码数据。

参数

数据
编码数据。

严格
返回FALSE如果输入包含字符以外的一个base64字母表。


返回值
返回原始数据或FALSE的失败。返回的数据可能是二进制。

修改

版本说明
5.2.0严格的补充


实例

例如# 1 base64_decode ( )的例子

$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
echo base64_decode($str);
?>
The above example will output:

This is an encoded string

base64_encode
( PHP 4中, PHP 5中)

base64_encode -使用MIME编码的数据进行Base64

描述
字符串base64_encode (字符串$数据)
编码特定数据进行Base64 。

这种编码是为了使二进制数据生存运输通过运输层不支持8 - bit编码,如电子邮件机构。

进行Base64编码的数据大约需要33 %以上的空间比原始数据。

参数

数据
这些数据进行编码。


返回值
编码数据,作为一个字符串。

实例

例如# 1 base64_encode ( )的例子

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

VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445458.htmlTechArticlephp base64_decode 与base64_encode base64_decode ( PHP 4中, PHP 5中) base64_decode -解码数据的Base64编码的MIME 描述 字符串base64_decode (字符串$数据[ ,布...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!