Answer the question
In order to leave comments, you need to log in
How to decode json in php?
Guys, please help. I broke my head and don't know what to do.
The fact is that the database stores a string in json format (?), but I don’t know how to decode it.
I connect via php to the mysql database where the string is stored, then I try to decode it using the standard json_decode method, but nothing happens.
A string in this format:
{"date-add-wl":{"field":{"id":3,"form_id":1,"priority":0,"type":"text","label":"\u0414\u0430\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442","slug":"date-add-wl","options":[],"data":{"value":[],"data":[],"classSfx":"","help_text":"","help_show":"","hasOptions":0,"placeholder":"dd-mm-yyyy","multiple":0,"controls":null,"repeatable":null,"required":true,"requiredError":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0434\u0430\u0442\u0443"},"roles":[3],"value":[],"valuedata":[],"formatted":["-"]},"slug":"date-add-wl","type":{"id":"text","label":"Textfield","hasOptions":0,"required":-1,"multiple":0,"placeholder":""},"label":"\u0414\u0430\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442","
value":["\u0425\u0443\u0439\u0444"],"
formatted":["-"],"data":[],"field_id":3},"nick":{"field":{"id":4,"form_id":1,"priority":1,"type":"text","label":"\u041d\u0438\u043a \u043d\u0430
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question