Heim  >  Artikel  >  php教程  >  用php过滤文字中的表情字符

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

WBOY
WBOYOriginal
2016-06-06 19:54:08901Durchsuche

很多时候,如果文字中夹带表情,那么这些文字的处理就会出现问题,例如,如果一个用户的昵称带有表情,那么我怎么把这个昵称转换为拼音呢?在实际的开发中,我遇到了这个个问题,先是找到了 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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn