PDA

View Full Version : Find last line in a file



spasticus
20 Oct 2006, 09:41 AM
hi, i need to some data to a file before the end of it.

im using xml and php to (at the moment) make a news posting thingy. anyway:

the end of my file looks like this:



</CONTENT>
</POST>

</ARCHIVE>

</ARCHIVE> being the last line. i need to add the data between </POST> and </ARCHIVE> but i can't find the last line which i'm guessing is what i need to do to add data to the line before it.

if anyone can post a script which can find the line i need or find the line and add some data i'd REALY appreciate it.

thanks.

spasticus
23 Oct 2006, 05:40 PM
ok forget it i got something now - forum guy you can delete this thread i dont need it anymore
:D