Jump to content

fwrite above last line


swamp

Recommended Posts

Hi,

 

I need to write to a txt file but leave the last line intact.

 

I'm using fwrite($handle, $content) but I need to keep the last line in my txt file which is "--Document End--"

 

For example if I write "new line of text" to "test.txt" I need it to show up as

 

(old content)

new line of text

--Document End--

 

Any hints?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/146523-fwrite-above-last-line/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.