title: json stringify to php
body: <p>I want to pass the key values into php page.</p>
  
  <p>At php page, I will start to read value by matching <code>ajaxcallid</code>.</p>
  
  <p>But it not working.</p>
  
  <p>It gotta do with syntax/way I am passing in causing error.</p>
  
  <pre><code>parse error
  invalid json: ajax call id is missing    
  </code></pre>
  
  <p>JavaScript/AJAX:</p>
  
  <pre><code>var person = { 
       "Address"    :   "123 Anywhere St.", 
       "City"       :   "Springfield", 
       "PostalCode" :   99999
  };
  
  alert(person);          
  
  person= JSON.stringify(person);
  
  alert(person);
  
  $.ajax({
      url: 'ROOT_URL/admin/ajaxtest.php',
      type: "POST",
      dataType: 'json',
      data: {ajaxcallid: '26', jsarr: person},
      timeout: 5000,
      success:  function(output) {
          alert(output.Address);
      },
  });
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  if (isset($_REQUEST['ajaxcallid']))
  {    
      if($_REQUEST['ajaxcallid']==26)
      {    
          //example, I want to read value of person.Address, person.City, 
          //person.PostalCode
      //what is the easiest way
          $phparr= json_decode($_REQUEST['jsarr']);
          //do all other operation
          $output= json_encode($phparr);
      }
  }
  else
  {
      $output= "ajax call id is missing";
  }
  echo $output;
  ?&gt;
  </code></pre>