I'm imagining you want something like a guestbook page, then a box on your mainpage with just the most recent entry?
If you are using fopen to create/write to your files, just have it fopen a second file, but instead of using the 'a' mode on the second file (to place the file pointer at the end of the file), use the w mode, which will overwrite what's in it.
Ex:
$string='My text to add.';
$file1 = fopen ("/home/web/guestbook.txt", "a");
$file2 = fopen ("/home/web/lastentry.txt", "w");
fwrite($file1,$string);
fwrite($file2,$string);
fclose($file1);
fclose($file2);
This is from memory, so it might not be exactly right, or the best way, but I think it should give you an idea at least.