title: Export an array to CSV failure: string given
body: <p>I can't solve a problem occurring when I try to export an array to a CSV file. I have used this function several times without problem but here I do not see where my mistake is.</p>
  <p>I set an array:</p>
  <pre><code>$mytags= array();
  </code></pre>
  <p>I populate it by a loop. When I print the content through <code>print_r($mytags);</code>
  it seems to be OK, here some examples of my output:</p>
  <pre><code>Array ( [0] =&gt; [1] =&gt; air-travel [2] =&gt; airports [3] =&gt; security-airport [4] =&gt; city-airport  ... )
  </code></pre>
  <p>After that I try to export the result to CSV by fputcsv:</p>
  <pre><code>$fp = fopen('file.csv', 'w');
  foreach ($mytags as $fields) {
      fputcsv($fp, $fields);
  }
  </code></pre>
  <p>But I get this error:</p>
  <blockquote>
  <p>Warning: fputcsv() expects parameter 2 to be array, string given in
  C:\wamp\www\tests\capturetags.php on line 55</p>
  </blockquote>
  <p>Could the problem be that there is only one field?
  Alternatively, I tried to replace <code>$fields</code> by <code>$mytags</code> to write the CSV, and in this case I get a 4GB files, so it's not the
  Does someone see how to record thhis unique field in a CSV file?</p>