title: Can PHP cURL retrieve response headers AND body in a single request?
body: <p>Is there any way to get both headers and body for a cURL request using PHP? I found that this option:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_HEADER, true);
  </code></pre>
  
  <p>is going to return the <strong>body plus headers</strong>, but then I need to parse it to get the body. Is there any way to get both in a more usable (and secure) way?</p>
  
  <p>Note that for "single request" I mean avoiding issuing a HEAD request prior of GET/POST.</p>