title: uncompressing xml feed gzip deflate php
body: <p>I am being sent an XML feed which needs to be downloaded in a 'compressed way'.</p>
  
  <p>The example I have been given is this:</p>
  
  <pre><code>$url = 'http://myurl.com';
  $headers[] = "Accept-Encoding: gzip,deflate";
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
  $data = curl_exec($ch);
  </code></pre>
  
  <p>but the output I am getting is jargon like this:</p>
  
  <p>��+T����s�ƒ-�}#���;}�w7f���d]K�F��x���HB$�&amp;����G�����6������IW���Y��'�����߷��sR,�&lt;������ �.��4���֫�'��������?''^�?9��;��*�9^|����>'�j�~���ǫ�}z��|���h���q���J����Գ"�.o������2)~���bU���~������I|</p>
  
  <p>How to a convert it back into XML?</p>
  
  <p>Many thanks</p>