When you write to the file, you will first need to fopen() the file, and depending on which mode you use, it will place the file pointer (where it writes the file data) at different places.
"r+" will place the pointer at the beginning of the file if you want to write content at the top.
"a" will place the pointer at the end of the file if you want to write content at the end.
More on this at: http://us2.php.net/manual/en/function.fopen.php
If you want to go by line numbers, you can first read the file into an array by using file(). Each line will be an array element, but the array keys will start at 0. If you want to add content after line 43, you would have to referr to key number 42 (which would be line 43).
__________________
<mgraphic /> - I don't have a solution but I admire the problem.
|