php中base64_encode和urlencode字符串加密方法
本文章介绍了关于利用了php的ase64_encode和urlencode来对字符串进行简单的加密处理,也是比较常用的方法,有需要的同学可参考一下本文章哦。
base64_decode
将 BASE64 编码字符串解码。
语法: string base64_decode(string encoded_data);
返回值: 字符串
函数种类: 编码处理
内容说明
本函数将以 MIME BASE64 编码字符串解码。解码后的字符串可能为中文字符串或其它的二进位资料。
例
代码如下 | 复制代码 |
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='; echo base64_decode($str); ?> |
str urlencode($string)
此功能是方便的编码字符串时要在URL的查询的一部分用来作为一种方便的方法传递变量到下一页。
我写了这个简单的函数,创建一个GET查询的网址()从一个数组:
代码如下 | 复制代码 |
$query_string = 'foo=' . urlencode($foo) . '&bar=' . urlencode($bar); echo ''; ?> |
看一个两个综合的函数
代码如下 | 复制代码 |
$encryption = "username"; echo base64_encode ($encryption);//echo "dXNlcm5hbWU= "; echo " "; echo urlencode("http://".$encryption);//echo " http%3A%2F%2Fusername "; echo " "; echo sha1($encryption);//echo "249ba36000029bbe97499c03db5a9001f6b734ec" echo " "; ?> |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor
