title: Create a new CSV file with template data in php
body: <p>I am attempting to write a php script, that will take an existing csv file, and open it for edit using the values of that file.</p>
  
  <pre><code>&lt;?PHP
  $file_handle = fopen("test.csv", "r");
  while (!feof($file_handle) ) {
  $line_of_text = fgetcsv($file_handle, 100000);
  echo "&lt;textarea name=textarea id=textarea cols=40 rows=4&gt;$line_of_text[0]&lt;/textarea&gt;";
  echo "&lt;textarea name=textarea id=textarea cols=40 rows=4&gt;$line_of_text[1]&lt;/textarea&gt;";
  echo "&lt;/br&gt;&lt;/br&gt;";
  }
  fclose($file_handle);
  ?&gt;
  </code></pre>
  
  <p>Thats not that difficult. Where it gets hairy, is i also need to be able to add additional rows using the same template data. I can think of how to do this, some kind of count based on a user selected value that would render the above data (plus a line break) x number of times. Im just not sure how to do that. By the way, the csv file in question has 25 columns, i just put in the first 2 for the sake of saving space.</p>
  
  <p>Also, once all this data is rendered, i need to save it in its entirety (all rows) to a NEW csv file.</p>