title: PHP: parse JSON from jQuery
body: <p>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 test I've written a page where the data is created; sends request to PHP page to do some tests.</p>
  
  <p>How can I access the JSON data from PHP and have it returned back?</p>
  
  <p>The string from jQuery:</p>
  
  <pre><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></pre>
  
  <p>PHP page:</p>
  
  <pre><code>&lt;?php
  
  $data_back = json_decode (stripslashes($_REQUEST['data_to_send']), true);
  print $data_back-&gt;{'id_list'[0]["id"]}; //??? how can I access to properties?
  
  ?&gt;
  </code></pre>