title: Refer to jQuery post data in PHP script
body: <p>Currently I am working on a ajax-based web application that does some XHR.</p>
  
  <p>I chose CakePHP + jQuery to do the jobs, they work pretty well except this little problem.</p>
  
  <p>Say, I make a String of a valid JSON form ==>    { "test" : "hello world"}</p>
  
  <p>Then I am calling jQuery's ajax method to send it to the destination php page:</p>
  
  <pre><code>jQuery.ajax
      ({
          type: 'POST',
          cache: false,
          async: false,
          timeout: 10000,
          url : 'http://localhost/method/',
          dataType : 'json',  //defines expected response datatype
          contentType : 'application/json', //defines request datatype
          data : { "test" : "hello world"},
          success : function(json)
          {
             //do some stuff here.
          }});
  </code></pre>
  
  <p>Previously I tried this ajax function with empty data (i.e. just use data : {} since this is a POST), and it worked just fine; however, now that I've added a json-formatted data to the HTTP POST, is there a way to refer to it from the PHP script's side?</p>
  
  <p>I tried : <code>data : { "data" : {"test" : "helloworld"}}</code></p>
  
  <p>I use PHP's isset[$_POST['data'] to check, and the result is POST variable 'data' is unset.</p>
  
  <p>Can anyone give me a way to solve this problem? Many thanks in advance!!!</p>