title: Reading from a text file after using curl
body: <p>I'm trying to debug a curl session but I can't seem to read the data from the file created. In the code below, file_get_contents returns false and a blank page shows up:    </p>
  
  <pre><code>&lt;?php
  
  $curl = curl_init();
  curl_setopt ($curl, CURLOPT_URL, "http://www.php.net");
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_VERBOSE, 1);
  $fh= fopen('test.txt', 'w+');
  curl_setopt($curl, CURLOPT_STDERR, $fh );
  curl_exec($curl);
  fclose($fh);
  curl_close($curl);
  echo file_get_contents("test.txt");
  ?&gt;
  </code></pre>
  
  <p>however when I use the code: </p>
  
  <pre><code>&lt;?php
  echo file_get_contents("test.txt");
  ?&gt;
  </code></pre>
  
  <p>the content in the text file displays just fine. </p>