S
S
skyfly20102016-06-10 19:35:48
PHP
skyfly2010, 2016-06-10 19:35:48

How to convert json string to php array?

Can you please tell me how to convert this string to php array?

{"result":{"goods":{"897255":{"group code":"","group":"41. \u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b","name":"\u041d\u0430\u0431\u043e\u0440 \u043a\u043e\u043b\u0435\u0441 \u0434\u043b\u044f \u043f\u0430\u0440\u043a\u0435\u0442\u0430\/\u043b\u0430\u043c\u0438\u043d\u0430\u0442\u0430 \u0411\u044e\u0440\u043e\u043a\u0440\u0430\u0442 CastorSet3850\/PU","producer":"","model":"CastorSet3850\/PU","warrancy":"","quantity":"2","USD":"0.00","BYR_BN":"0"},"987709":{"group code":"","group":"42. \u041f\u043e\u0441\u0443\u0434\u0430, \u043a\u0443\u0445\u043e\u043d\u043d\u0430\u044f \u0443\u0442\u0432\u0430\u0440\u044c","name":"\u041a\u0430\u0440\u0442\u0440\u0438\u0434\u0436 \u0411\u0410\u0420\u042c\u0415\u0420 \u041f\u0440\u043e\u0444\u0438 Complex","producer":"","model":"","warrancy":"","quantity":"1","USD":"0.00","BYR_BN":"464499"},"891223":{"group code":"","group":"44. \u041c\u0435\u0431\u0435\u043b\u044c \u0438 \u0438\u043d\u0442\u0435\u0440\u044c\u0435\u0440","name":"\u041d\u0430\u0434\u0443\u0432\u043d\u043e\u0435 \u043a\u0440\u0435\u0441\u043b\u043e Intex 68564","producer":"Intex","model":"68564","warrancy":"12","quantity":"1","USD":"24.00","BYR_BN":"0"},

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
ThunderCat, 2016-06-10
@skyfly2010

$arr = json_decode($data);
$arr = $arr["result"]["goods"];

А дальше можете и форичем.

Андрей Minisol, 2016-06-10
@AmadeyMinisol

json_decode($data,true)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question