I was attempting to store chat logs in a MySQL database where the message field is utf8_general_ci
However, when it came across an emoji, it would choke, and the message field would only include text up to the emoji character.
I changed the message field to be utf8mb4_general_ci, which seemed to be suggested upon googling, and now emoji characters are replaced in the database with four question mark characters, instead of choking.
What is the best way to encode/decode emoji characters so that they can be accurately represented? (Ideally with PHP)