title: PHP Receiving XML
body: <p>I have a small PHP script that is listening for a POST request.  I'm expecting xml, always.
  Normally I'm the guy sending the xml requests.  But today I'm on the receiving side.</p>
  
  <p>I figured it would be a simple case of listening for a $_POST, but I guess I may be incorrect - I'm getting nothing.</p>
  
  <p>Here's my script that waits for anything xml:</p>
  
  <pre><code>&lt;?php
  if(isset($_POST)) {
      mail("me@myemail.com","some title i want", print_r($_POST, true)); 
  }else{
      die("uh, what happened?");
  }
  ?&gt;
  </code></pre>
  
  <p>And here is a simple xml string I'm sending from another place:</p>
  
  <pre><code>&lt;?php
  $xml_data ='
  &lt;note&gt;
  &lt;to&gt;Tove&lt;/to&gt;
  &lt;from&gt;Jani&lt;/from&gt;
  &lt;heading&gt;Reminder&lt;/heading&gt;
  &lt;body&gt;Don\'t forget me this weekend!&lt;/body&gt;
  &lt;/note&gt;
  ';
  
  function sendXML2Server($URL,$XML){
      $xml_data = trim($XML);
      $ch = curl_init($URL);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
      curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      $output = curl_exec($ch);
      curl_close($ch);
  
      return $output;
  }
  
  echo sendXML2Server('https://someurl.com/inboundxml.php',$xml_data)
  ?&gt;
  </code></pre>
  
  <p>And here's what I get in my email:</p>
  
  <p><strong>Array
  (
  )</strong></p>
  
  <p>I'm guessing I'm not working with an array correctly, but maybe there's something else I'm missing in all this.  I'm expecting to get back the actual xml string.</p>