title: How to decode "Content-Encoding: gzip, gzip" using curl?
body: <p>I am trying to decode the webpage www.dealstan.com using CURL by using the below code:</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url); // Define target site
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Return page in string
  curl_setopt($cr, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.3 Safari/533.2');
  curl_setopt($ch, CURLOPT_ENCODING , "gzip");     
  curl_setopt($ch, CURLOPT_TIMEOUT,5); 
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); // Follow redirects
  
  $return = curl_exec($ch); 
  $info = curl_getinfo($ch); 
  curl_close($ch); 
  
  $html = str_get_html("$return");
  echo $html;
  </code></pre>
  
  <p>but, it is showing some junk charater</p>
  
  <p>"��}{w�6����9�X�n���.........." for about 100 lines.</p>
  
  <p>I tried to find the response in hurl.it, found one interesting point, it looks like the html is encoded twice(just a guess, based on the response)</p>
  
  <p>Find the response below:
   GET <a href="http://www.dealstan.com/">http://www.dealstan.com/</a></p>
  
  <p>200 OK      18.87 kB      490 ms
  View Request View Response
  HEADERS</p>
  
  <p>Cache-Control: max-age=0, no-cache</p>
  
  <p>Cf-Ray: 18be7f54f8d80f1b-IAD</p>
  
  <p>Connection: keep-alive</p>
  
  <p>Content-Encoding: gzip, gzip     ==============>? suspecting this, anyone know about it?</p>
  
  <p>Content-Type: text/html; charset=UTF-8</p>
  
  <p>Date: Wed, 19 Nov 2014 18:33:39 GMT</p>
  
  <p>Server: cloudflare-nginx</p>
  
  <p>Set-Cookie: __cfduid=d1cff1e3134c5f32d2bddc10207bae0681416422019; expires=Thu, 19-Nov-15 18:33:39 GMT; path=/; domain=.dealstan.com; HttpOnly</p>
  
  <p>Transfer-Encoding: chunked</p>
  
  <p>Vary: Accept-Encoding</p>
  
  <p>X-Page-Speed: 1.8.31.2-3973</p>
  
  <p>X-Pingback: <a href="http://www.dealstan.com/xmlrpc.php">http://www.dealstan.com/xmlrpc.php</a></p>
  
  <p>X-Powered-By: HHVM/3.2.0
  BODY view raw</p>
  
  <p>H4sIAAAAAAAAA5V8Q5AoWrBk27Ztu/u2bdu2bdu2bdu2bds2583f/pjFVOQqozZnUxkVJ7PwoyAA/qeAb3y83LbYHs/3Hv79wKm/2N5cZyJVtCWu1xyteyzLNqYuWbdtHeELCyIZRRp/1Fe7es3+wL3Vfb</p>
  
  <p>anyone knows how to decode the response with the header "Content-Encoding: gzip, gzip", </p>
  
  <p>That site is loading properly in firefox, chrome etc. but, i am not able to decode using CURL. </p>
  
  <p>Please help me to decode this issue?</p>