title: Getting the cURL stream in PHP
body: <ol>
  <li><p>If I run <code>curl_exec</code> with no options, the fetched page gets output on php's standard output (the html page being served back).</p></li>
  <li><p>If I run it with the <code>RETURNTRANSFER</code> option set, I can get the whole page in a variable.</p></li>
  </ol>
  
  <p>How can I get a stream, that I can then manually parse?</p>
  
  <p>In case 1, I cannot access the data to parse it and in case 2, I need to wait until it is fully downloaded before starting to parse it. I would like something similar to <code>fopen()</code> and <code>fread()</code> where <code>fread($curl_handle, 1000)</code> would return as soon as the first 1000 bytes have been read, and the second call would be return after 2000 bytes have been read, etc.</p>