For some reason I can't delete from line [0], anyone reasons? This is the code I use:
<?
$del_data = "";
$current_line = 0;
$write_line = $getline;
$contents = "";
$fp = fopen ("target.txt", "r"); reading
while ($data = fgets($fp, 4096))
{
$current_line++;
if ($current_line == $write_line)
{
$contents .= $del_data;
} else {
$contents .= $data;
}
}
fclose($fp);
$fp = fopen("target.txt", "w");
fputs($fp, $contents);
fclose($fp);
?>