title: PHP CURL to get contents of a https page
body: <p>Example url:
      <a href="https://www.tescogoldexchange.com/gold-calculator.aspx?carat=9&amp;weight=1&amp;ref=miniQuote" rel="nofollow">https://www.tescogoldexchange.com/gold-calculator.aspx?carat=9&amp;weight=1&amp;ref=miniQuote</a></p>
  
  <p>I am trying to use cURL to get the contents of an HTTPS page.</p>
  
  <p>Problem is that I am not able to grab the document and I have no idea why.</p>
  
  <pre><code>    function download_page($url){
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
  
      return curl_exec($ch);
  }
  </code></pre>