Home > php教程 > php手册 > body text

用php过滤文字中的表情字符

WBOY
Release: 2016-06-06 19:54:08
Original
901 people have browsed it

很多时候,如果文字中夹带表情,那么这些文字的处理就会出现问题,例如,如果一个用户的昵称带有表情,那么我怎么把这个昵称转换为拼音呢?在实际的开发中,我遇到了这个个问题,先是找到了 https://github.com/iamcal/php-emoji 这个转换表情的类库,但发现

   很多时候,如果文字中夹带表情,那么这些文字的处理就会出现问题,例如,如果一个用户的昵称带有表情,那么我怎么把这个昵称转换为拼音呢?在实际的开发中,我遇到了这个个问题,先是找到了 https://github.com/iamcal/php-emoji这个转换表情的类库,但发现这个类库不支持ios6后新增的表情,最后没办法了,我写了个抓取程序,把 http://punchdrunker.github.io/iOSEmoji/table_html/ios6/index.htmlios6后新增的表情抓取出来,并写了个新的类库并开源了 https://github.com/newjueqi/converemojitostr,这个类库的作用就是把文字中夹带的表情替换为一个特殊的字符(默认是"#")

 

[文章作者]曾健生

[作者邮箱]h6k65@126.com

[作者QQ]190678908

[新浪微博] @newjueqi

[博客]http://blog.csdn.net/newjueqi

          http://blog.sina.com.cn/h6k65

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!