php处理emoji表情 存数据库
PHP 处理emoji表情 存数据库
直接过滤掉
1 function filter_emoji($str) { 2 $regex = '/(\\\u[ed][0-9a-f]{3})/i'; 3 $str = json_encode($str); 4 $str = preg_replace($regex, '', $str); 5 return json_decode($str); 6 }
个人博客: | https://blog.nanshaobit.top |
CSDN: | https://blog.csdn.net/LZ_nanshao |
码云: | https://gitee.com/nanshaobit |
Github: | https://github.com/nanshaobit |