title: parameter error with fputcsv() in PHP
body: <p>I am trying to run through a dictionary, .txt file, calculate the <code>metaphone()</code> values and append that to each line. Then write this to a new file.</p>
  
  <p>I am getting an error though on the line that I am using <code>fputcsv()</code> and it says: <strong>expects parameter 1 to be resource, boolean given</strong></p>
  
  <p>I don't believe I am passing it a boolean. I don't understand what I am doing wrong.</p>
  
  <pre><code>&lt;?php
  $dict = fopen("originalDictionary.txt", "r");
  $keyedDict = fopen("dictionary.txt", "w");
  while ($line = fgets($dict)){
      $line = trim(strtolower($line));
      fputcsv($keyedDict, array($line,metaphone($line)));
  }
  fclose($dict);
  fclose($keyedDict);
  ?&gt;
  </code></pre>
  
  <p><a href="http://the-irf.com/dictionary-orig.txt" rel="nofollow">Here is a link to originalDictionary.txt</a> if that helps.</p>