存入数据库时转译一下
urlencode($wxuser["nickname"]);
取出时解析
urldecode($mydata["nickname"]
导出到excel时,替换
$this->filterEmoji(urldecode($mydata["nickname"]))
functionfilterEmoji($str)
{
$str=preg_replace_callback(
'/./u',
function(array$match) {
returnstrlen($match[0]) >=4?'':$match[0];
},
$str);
return$str;
}
网友评论