StupidBeauty
Read times:959Posted at:Sat Jul 20 23:27:56 2013
- no title specified

转载php中用base64实现加密解密

使用base64_encode函数可将任意字符串转换成base64编码,适合于以文本形式传输。

http://www.phpzixue.cn/detail704.shtml

亮点:

string base64_encode ( string data )
base64_encode() returns 使用 base64 对 data 进行编码。设计此种编码是为了使二进制数据可以通过非纯 8-bit 的传输层传输,例如电子邮件的主体。
Base64-encoded 数据要比原始数据多占用 33% 左右的空间。

string base64_decode ( string encoded_data )
base64_decode() 对 encoded_data 进行解码,返回原始数据,失败则返回 FALSE。返回的数据可能是二进制的。
看下面的例子:
例子 1. base64_encode() 示例
<?php
$str = 'This is an encoded string';
echo base64_encode($str);
?>
此例将显示:
VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==

谁让我加班,就枪毙谁

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4