php 过滤emoji

function  filter_emoji_string($str){
$str = trim($str);
$str = preg_replace_callback('/./u',function (array $match) {return strlen($match[0]) >= 4 ? '' : $match[0];},$str);
return $str;
}
原文地址:https://www.cnblogs.com/cbugs/p/6869217.html