php 加密解密小程序

dafenqi
2023-08-09 / 0 评论 / 14 阅读 / 正在检测是否收录...

php 加密解密小程序

php 加密解密小程序,按键盘顺序重新排序字母表

$subject=$_GET['s'];
$replace = ['a'=>'q','b'=>'w','c'=>'e','d'=>'r','e'=>'t','f'=>'y','g'=>'u','h'=>'i','i'=>'o','j'=>'p','k'=>'a', 
 'l'=>'s','m'=>'d','n'=>'f','o'=>'g','p'=>'h','q'=>'j','r'=>'k','s'=>'l','t'=>'z','u'=>'x',
'v'=>'c','w'=>'v','x'=>'b','y'=>'n','z'=>'m'];
$encrypt=strtr($subject, $replace);
$decrypt=strtr($encrypt, array_flip($replace));

echo '加密:'.$encrypt;
echo '解密:'.$decrypt;
//输入abcdefg
//输出 加密:qwertyu解密:abcdefg
0

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/testblog.58heshihu.com/var/Widget/Archive.php on line 1032

评论 (0)

取消