Hi
I want to know how you add a new line to the top. Please answer.
Can Yilmaz wrote:
Hi,
I need to write to the top of the file on my file system. The file I try to add the new line is a big like nearly 2 mb. and I don't want to make the system slow by reading the file first..
I tried the code below :
$fd = fopen ($dosya, "r+");
fputs($fd, "Cando: 1\r\n$gottime");
fclose ($fd);
but this code replaces the top of the text with the one I wrote forexample if the file contains :
helo
how are you now
when I used the code the file returns :
Cando:1
ow are you now
but I want it to be as :
Cando: 1
helo
how are you now
is there a way to add a new line on the top of file without changing the contents of file?
Can Yilmaz