I have the following array:
Array
(
[1] => Array
(
[time] => 07:30
[event] => Celebrity Organ Recital â€" Sophie-Véronique Cauchefer-Choplin
)
)
(original event line: "Celebrity Organ Recital - Sophie-Véronique Cauchefer-Choplin", I used htmlentities with ENT_QUOTES)
When I use json_encode, the event string is returned as NULL and it is saved as an empty string in MySQL.
If I do not use htmlentities. I will get this in my database: "Celebrity Organ Recital u2013 Sophie-Vu00e9ronique Cauchefer-Choplin". I have used many methods, but I still cannot convert this string to the original one.
I really need some hints, I hope you could give me a solution to encode a UTF-8 string, as above, in json, and then save it in MySQL and then decode back to its original. I searched for a while, but still can't find a solution.
Thank you very much!
source
share