title: CURL doesn't return any output when reading URL
body: <p>I am reading a CSV file which contain URLs. I am trying to output the result of those URLs but facing strange issue.
  I can't seem to understand why this code doesn't print variable $output when you try to print item which is on first line.</p>
  
  <p>This is my CSV file containing two records:</p>
  
  <pre><code>www.serverfault.com
  www.stackoverflow.com
  </code></pre>
  
  <p>This is my code</p>
  
  <pre><code>&lt;?php
  $myfile = fopen("products.csv", "r") or die("Unable to open file!");
  
      while(!feof($myfile))
      {
          $myline = fgets($myfile);
  
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $myline);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          $output = curl_exec($ch);
          curl_close($ch);
  
          if($myline == "www.serverfault.com")
          {
              echo $output;
          }
      }
  ?&gt;
  </code></pre>
  
  <p>Notice in CSV file the first record is www.serverfault.com and it never prints the $output. If I move this record to second line then it prints $output but then it doesn't print $output for www.stackoverflow.com which is on first line now.</p>
  
  <p>What's going on?</p>