Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn Thinkphp's default utf8 does not support Emoji, because Emoji is unicode encoded and each Emoji occupies 4 bytes, you only need to change the data table and column encoding to utf8mb4.
I found a bunch of articles on the Internet and did not write them clearly.
The default utf8 of Thinkphp does not support Emoji because Emoji is unicode encoded and each Emoji occupies 4 bytes. You can use the following method.
1. Ensure that mysql version is later than 5.3.3 (utf8mb4 is supported)
2. Change the table character set to utf8mb4 and arrange the order utf8mb4_general_ci.
3. Change the field character set to utf8mb4 and arrange the order utf8mb4_general_ci.
Utf8mb4 is an extension of utf8 and is backward compatible, so you can use it with confidence, but remember to back up
Some emoji are still displayed as question marks. For more information, see.
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB