No, if you want to change only one row you have to read the whole file and write the whole content. Here a small sample
<?php
$rowno = 5; // row# to be updated
$warenemy1 = $clantag;
$filename = "lastwar.php";
@$fp = fopen($filename,"r"); // Open file for read
if (!$fp) {
print "File $filename doesn't exist<br>\n";
} else {
$fileok = "ok";
while (!feof($fp)) {
$row[] = fgets($fp, 4096); // build array with content of file
}
}
@fclose($fp);
if ($fileok == "ok") {
$fp = fopen($filename,"w"); // Opne file for write
for ($i=0;$i<sizeof($row);$i++) { // Reading array an write content to file
if ($i != $rowno - 1) { // If rowno reached
$zeile = $row[$i];
} else {
$zeile = "$"."warenemy1 = '$warenemy1';\n";
}
fputs($fp, $zeile); // write content
}
fclose($fp);
}
?