title: PHP: Get single value from txt file
body: <p>I have this text-file:</p>
  
  <pre><code>STATIONS_ID;MESS_DATUM;  QN;PP_10;TT_10;TM5_10;RF_10;TD_10;eor
     5371;201912250000;    2;  903.5;   2.3;   2.2; 100.0;   2.3;eor
     [...]
     5371;201912251820;    2;  913.3;   0.4;   0.3; 100.0;   0.4;eor
  </code></pre>
  
  <p>And I want to get ONLY the last line with timestamp 25-12-2019 18:20 (201912251820).</p>
  
  <p>Thats my php code (finally I want to save the data in my MySQL database):</p>
  
  <pre><code>$row = 1;
  if(($handle = fopen("produkt_zehn_now_tu_20191225_20191226_05371.txt", "r")) !== FALSE) 
  {
      while(($data = fgetcsv($handle, 1000, ",")) !== FALSE) 
      {
          echo "&lt;p&gt; 1 fields in line $row: &lt;br /&gt;&lt;/p&gt;\n";
          $row++;
  
          for($c=0; $c &lt; 1; $c++) 
          {
              echo $data[$c] . "&lt;br /&gt;\n";
  
              $daten = $data[$c];
              $carray = explode(";", $daten);
              list($station,$zeit,$quali,$luftdruck,$temp2m,$temp5cm,$feuchte,$taupunkt) = $carray;
  
              echo "&lt;b&gt;temp2m:".$temp2m."&lt;/b&gt;";
  
              /*
              $res_wetterdaten_dwd = $sql_datenbank -&gt; query("INSERT INTO wetterdaten_dwd 
              (daten_zeit, daten_luftdruck, daten_temp2m, daten_temp5cm, daten_feuchte, daten_taupunkt, daten_station)
              VALUES ('".$zeit."', ".$luftdruck.", ".$temp2m.", ".$temp5cm.", ".$feuchte.", ".$taupunkt.", ".$station.")");
              */
          }
      }
      fclose($handle);
  }
  </code></pre>