php - emoji display problem in web
迷茫
迷茫 2017-06-27 09:18:11
0
2
750

php stores emoji expressions in WeChat. Before storing in the database, I printed it on the page and the expressions can be displayed normally. Then after storing them in the database (utf8mb4), the expressions can also be displayed normally in the database. But what happens when PHP reads the expressions in the database and displays them on the page? .
Why is this? Does it still need to be transcoded or something?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
滿天的星座

emoji is an expression picture, but when it is saved to the database, it is the encoding corresponding to the saved picture. After you take it out, you still have to find the corresponding picture with the code!

给我你的怀抱

As you said in the last sentence, it needs to be converted (but not HTML transcoding). Emoji is an emoticon and needs a map to associate it.
That is, encoding -> picture

For details, you can look at this open source project. It has everything I said, and it belongs to a specific example:

https://github.com/iamcal/php-emoji
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!