I need your help since I have a problem with accents and special characters. The thing is that I need to save an array in a database, so what I do is the following:
$serialized_array = json_encode($products, JSON_UNESCAPED_UNICODE);
The problem is that then when I retrieve this array from the database and do json_decode($serialized_array); it doesn't return anything.
Instead, if I do:
$serialized_array = json_encode($products);
Then when I do decode it returns the array but with the wrong tildes:
["Platos del d\u00eda","Plato - Los dos juntos"]
Database connection:
$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
mysqli_set_charset($link, "utf8mb4");
What can I do?
Thank you so much.