I'm attempting to display Emojis stored in my mysql database in the web browser and having issues. Initially the emoji's were being translated into
????
so did some research and have changed the charset of the desired table to utf8mb4. I am now able to store the unicodes in the database eg.
😴
💛
However when i retrieve the string via php that these are stored in, from the database i am only seeing the text around the codes and the codes themselves and not the emoji's. eg
"had a great weekend with the family 💛"
instead of:
"had a great weekend with the family 💛"
any suggestions what I'm doing wrong?
EDIT
Solved my issue. I was using
htmlspecialcahrs()
on the input of the strings I want to store. This was converting the
&
to
&
causing the Emoji's not to be recognised as
&#128564
is not valid. I just had to remove the
htmlspecialchars
re-insert the strings and it worked!
Thanks for looking