2017-07-26 3 views

Antwort

0
$myFile = "file.txt"; 
$txt = ''; 
$file = file($myFile); 
foreach ($file as $row_num => $row) { 
    if ($row_num == 1) { 
     $txt .= 'line 2'; 
    } else { 
     $txt .= $row_num . '-' . $row . '<br>'; 
    } 
} 
$file_o = fopen($myFile, "w"); 
fwrite($file_o, $txt); 
fclose($file_o); 
Verwandte Themen