title: cUrl - getting the html response body
body: <p>I'm sure this is fairly simple. I'm using the function below to retrieve sites raw html
  in order to parse it. during my testing, I decided to run my code on stackoverflow.com</p>
  
  <p>Instead of getting the html response the Chrome is printing out the actual site rather then assigning the html to its veritable. What am I missing?</p>
  
  <pre><code>function get_site_html($site_url) 
  {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_COOKIESESSION, true);
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
      curl_setopt($ch, CURLOPT_MAXREDIRS, 4);
      curl_setopt($ch, CURLOPT_FORBID_REUSE, true);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
      curl_setopt($ch, CURLOPT_URL, $site_url);
  
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
      $response = curl_exec($ch);
  
      global $base_url; 
      $base_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
      $http_response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  
      curl_close ($ch);
      return $response;
  }
  </code></pre>
  
  <blockquote>
    <p>The site raw html should be assigned to $response, and then return it.</p>
  </blockquote>