title: PHP - read and write data from csv file. Weird thing
body: <p>So i made test code:</p>
  
  <pre><code>$fopen = fopen('./mydata.csv',"r");    
  $data = fgetcsv($fopen, 1000, ",");
  fclose($fopen);
  $fp = fopen('mynewdata.csv','a');
  fputcsv($fp,$data,',');
  fclose($fp);    
  </code></pre>
  
  <p>Content of mydata.csv file:</p>
  
  <blockquote>
    <p>string "some thing", sec string,next string</p>
  </blockquote>
  
  <p>New content of mynewdata.csv file:</p>
  
  <blockquote>
    <p>"string ""some thing"""," sec string","next string"</p>
  </blockquote>
  
  <p>My question is: Where this ' " ' comes from. What i do wrong that my output is different than input.</p>
  
  <p>Few more obserwations:</p>
  
  <p>When i do test like, with enclosure: '' -> empty string:</p>
  
  <pre><code>$data = fgetcsv($fopen, 1000,',','');
  print_r($data);
  </code></pre>
  
  <p>It print's nothing insted of array with 2 rows, and that's the error i got from logs:
  " FastCGI sent in stderr: "PHP message: PHP Warning:  fgetcsv(): enclosure must be a <strong>character</strong>" So what would be the other option to give as the enclosure an empty string.</p>