title: PHP Update CSV - fput()
body: <p>I want to open a csv file with following entries:</p>
  
  <pre><code>Firma,Anrede,Titel,Vorname,Nachname,Strasse,PLZ,Telefon,Fax,Email,Nachricht,CopyFlag,Importiert,Importdate,Importtime
  Testfirma1,Herr,Dr.,Vorname1,Name1,Strasse1,11111,12345567,123456,1@keine.de,nachricht1,1,,24.03.2016,22:00:00
  Testfirma2,Herr,Dr.,Vorname2,Name2,Strasse2,22222,22345567,223456,2@keine.de,nachricht2,1,,25.03.2016,22:00:00
  Testfirma3,Herr,Dr.,Vorname3,Name3,Strasse3,33333,32345567,323456,3@keine.de,nachricht3,1,,25.03.2016,22:00:00
  Testfirma4,Herr,Dr.,Vorname4,Name4,Strasse4,44444,42345567,423456,4@keine.de,nachricht4,1,,25.03.2016,22:00:00
  </code></pre>
  
  <p>Than I want to check if there's nothing in Column 12 (<code>Importiert</code>), and check if the <code>importtime</code> is &lt; than the <code>systemtime</code>. If both are true I want to send this data to curl doing some post. When this is done, I want to write a timestamp in column 12. I tried it with this example:</p>
  
  <pre><code>$fp = fopen("Testformular.csv", "r+"); 
  $line = 0;
  while ( $row = fgetcsv($fp) ) {
      if($line === 0){
          $line++;
          continue;};
     $actual = date("d.m.Y - H:i:s", time());
     $csvtime=  date("d.m.Y - H:i:s", strtotime($row[13]. $row[14]));
     if (empty($row[12])){
          if ($actual &gt; $csvtime){
              $output = "";
              $output .= 'tx_btsimplecontact_pi1[name]=' . urlencode("");
              $output .= '&amp;tx_btsimplecontact_pi1[firma]=' . urlencode($row[0]);
              $output .= '&amp;tx_btsimplecontact_pi1[sex]=' . urlencode($row[1]);
              $output .= '&amp;tx_btsimplecontact_pi1[titel]=' . urlencode($row[2]);
              $output .= '&amp;tx_btsimplecontact_pi1[vorname]=' . urlencode($row[3]);
              $output .= '&amp;tx_btsimplecontact_pi1[nachname]=' . urlencode($row[4]);
              $output .= '&amp;tx_btsimplecontact_pi1[strasse]=' . urlencode($row[5]);
              $output .= '&amp;tx_btsimplecontact_pi1[plz_ort]=' . urlencode($row[6]);
              $output .= '&amp;tx_btsimplecontact_pi1[telefon]=' . urlencode($row[7]);
              $output .= '&amp;tx_btsimplecontact_pi1[fax]=' . urlencode($row[8]);
              $output .= '&amp;tx_btsimplecontact_pi1[email]=' . urlencode($row[9]);
              $output .= '&amp;tx_btsimplecontact_pi1[nachricht]=' . urlencode($row[10]);
              $output .= '&amp;tx_btsimplecontact_pi1[copy]=' . urlencode($row[11]);
              $output .= '&amp;submit=Abschicken';
              print_r ($row);
              print ($output);        
              $row[12]= $actual;      
              print_r ($row);
              fputcsv($fp,$row);  
              };
          };
  curl ('http://www.post.html', "$output");
  };
  </code></pre>
  
  <p>The output in CSV is following:</p>
  
  <pre><code>Firma,Anrede,Titel,Vorname,Nachname,Strasse,PLZ,Telefon,Fax,Email,Nachricht,CopyFlag,Importiert,Importdate,Importtime
  Testfirma1,Herr,Dr.,Vorname1,Name1,Strasse1,11111,12345567,123456,1@keine.de,nachricht1,1,,24.03.2016,22:00:00
  Testfirma1,Herr,Dr.,Vorname1,Name1,Strasse1,11111,12345567,123456,1@keine.de,nachricht1,1,"25.03.2016 - 01:10:15",24.03.2016,22:00:00
  name3,Name3,Strasse3,33333,32345567,323456,3@keine.de,nachricht3,1,,25.03.2016,22:00:00
  name3,Name3,Strasse3,33333,32345567,323456,3@keine.de,nachricht3,1,,25.03.2016,22:00:00,"25.03.2016 - 01:10:16"
  </code></pre>