Thanks for reply!
I tried something that I thought would work, but no...
<?php
$file = fopen("dok.txt", 'r');
$linenumber = 0;
$line_no = 3;
$return = "";
$var = "the text";
while(!feof($file)) {
$line = fgets($file, 4096);
$linenumber++;
if($linenumber == $line_no){
$return .= $line . $var;
}
else {
$return .= $line;
}
}
fclose($file);
$file = fopen('dok.txt', 'w');
fputs ($file, $return);
fclose($file);
?>
The result in dok.txt:
Line1text-
Line2text-
Line3text-
the textLine4text-
Line5text-
Line6text-
Now i'm not sure if i write to line 3, and there is some "/n" tag that makes it go in the beginning of line 4, or i'm writing to line 4 and there is a problem with $return...
Any ideas anyone?