title: Parsing result from file_get_contents('php://input')
body: <p>I'm using <code>file_get_contents('php://input')</code> to retrieve all the POST parameters/values from a particular web service, e.g.:</p>
  
  <pre><code>$postText = file_get_contents('php://input');
  </code></pre>
  
  <p>which results in something like this:</p>
  
  <pre><code>inReplyToId=MG1133&amp;to=61477751386&amp;body=test&amp;from=61477751386&amp;messageId=166594397&amp;rateCode=
  </code></pre>
  
  <p>I then need to get each of the individual key/value pairs as I need to set them into fields in a new database record. For example I would like to end up with:</p>
  
  <pre><code>$inReplyToId = MG1133
  $to = 61477751386
  $body = test
  </code></pre>
  
  <p>Once I know the individual value I can set the corresponding field in the database. I would normally use:</p>
  
  <pre><code>if(isset($_POST['inReplyToId']) &amp;&amp; $_POST['inReplyToId'] !== '' ) {
      $request-&gt;setField('_kf_GatewayMessageID', $_POST['inReplyToId']);
  }
  </code></pre>
  
  <p>But that won't work in this case as it's not a <code>application/x-www-form-urlencoded</code> form that is being submitted.</p>