21,886
社区成员
发帖
与我相关
我的任务
分享
你这种情况,是不是你的框架的链接数据库配置那里的字符集是utf8,把它设置成utf8mb4,就好了
$text = base64_decode('8J+YhPCfmIM=');
echo $text = preg_replace_callback('/[\xf0-\xf7].{3}/', function($r) { return '@E' . base64_encode($r[0]);}, $text);
@E8J+YhA==@E8J+Ygw==
都会后逆转换一下就可以了
$s = preg_replace_callback('/@E(.{6}==)/', function($r) {return base64_decode($r[1]);}, '@E8J+YhA==@E8J+Ygw==');
var_dump(base64_decode('8J+YhPCfmIM=') == $s);
bool(true)