title: Wrap CSV values generated by PHP fputcsv() with " "
body: <p>So, my code generates a CSV file using PHP's built-in <a href="http://us3.php.net/manual/en/function.fputcsv.php" rel="noreferrer"><code>fputcsv</code></a> function.</p>
  
  <p>For the delimiter, I use <code>','</code> (a comma).<br>
  For the enclosure, I use <code>'"'</code> (a double-quote).</p>
  
  <p>However, when I try something like </p>
  
  <pre><code>fputcsv($file,array('a','b',"long string, with commas",NULL,''),',','"');
  </code></pre>
  
  <p>it outputs</p>
  
  <pre><code>a,b,"long string, with commas",,
  </code></pre>
  
  <p>but I would like it to output</p>
  
  <pre><code>"a","b","long string, with commas","",""
  </code></pre>
  
  <p>Is there an easy way to deal with this, or would I have to write a replacement for <code>fputcsv</code>?</p>