...as opposed to append.
Basically taking input from a web form, and appending it to a text file, which is being used as a simple guestbook. But I'd like the posts to appear at the top of the text file, instead of the bottom.
Seeing as fopen doesn't support this, is the only way to do this by copying the file into a temporary file, writing the new entry into the main file, then appending the temp file back on?
Basically taking input from a web form, and appending it to a text file, which is being used as a simple guestbook. But I'd like the posts to appear at the top of the text file, instead of the bottom.
Seeing as fopen doesn't support this, is the only way to do this by copying the file into a temporary file, writing the new entry into the main file, then appending the temp file back on?