title: how to get json data from iphone post request
body: <p>I am developing an iPhone App using JSON framework, I am calling a PHP script to update MySQL database on local server. Using these code:</p>
  
  <pre><code>NSString *jsonString = [sendData JSONRepresentation];
  NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
  NSString*post = [NSString stringWithFormat:@"&amp;json=%@", jsonString];
  NSData*postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:NO];
  
  [request setURL:[NSURL URLWithString:@"http://localhost:8888/update.php"]];
  [request setHTTPMethod:@"POST"];
  [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
  [request setHTTPBody:postData];
  </code></pre>
  
  <p>I would like to ask:</p>
  
  <p>What is the PHP script to get data from that request, and how I can decode JSON data to PHP object to update to database?</p>
  
  <p>Any help would be appreciated.</p>