ejfjeklikajdk
New Member
I'm trying to parse a simple \[code\]JSON\[/code\] string, but I'm not used to do it from \[code\]PHP\[/code\]. To do my testo I've wrote a js page where the data is created, sent to php page and returned back to do some test.how can I access to json data from PHP and return them back?the string from jQuery:\[code\]var json_str = '{"id_list":[{"id":"2","checked":"true"},{"id":"1","checked":"false"}]}';/*'{ "id_list": [ { "id": "2", "checked": "true" },{ "id": "1", "checked": "false" } ]}'*/$.post ("php_json_parser.php", { data_to_send:json_str }, function (data_back) { alert (data_back);});\[/code\]php page:\[code\]<?php$data_back = json_decode (stripslashes($_REQUEST['data_to_send']), true);print $data_back->{'id_list'[0]["id"]}; //??? how can I access to properties??>\[/code\]