title: How can I use PHP to take raw POST data and save to a file?
body: <p>I'm working with an interface standard for exchanging information about the planned, current or projected performance of real-time public transport operations between different computer systems. <a href="http://www.kizoom.com/standards/siri/" rel="nofollow noreferrer">This standard is called SIRI</a>.</p>
  <p>To cut a long story short, I've made a subscription with a service that sends me XML data through this interface every 30 seconds. From what I've highlighted in the red box below, it states that HTTP is used to send this data which is what I would have preferred.</p>
  <p>I need to create a PHP file that can listen for this HTTP data and then save it to a file (overwriting the previous file every 30 seconds).</p>
  <p>I've done some preliminary research into how I can go about doing this and I've done a little reading on:</p>
  <pre><code>$HTTP_RAW_POST_DATA
  </code></pre>
  <p>and</p>
  <pre><code>php://input
  </code></pre>
  <p>How can I come up with a PHP solution for doing this with one of these methods or a better one?</p>
  <p><img src="https://i.stack.imgur.com/n6l3p.png" alt="Enter image description here" /></p>