// Read the original file into an array
$olddata = file('news.txt');
// Delete the original file
unlink('news.txt');
// Using error_log(), write the new message to the file we just deleted. Error_log will create the file if it doesn't exist then add the message to the end of the file. Error_log takes care of all file opens and closes.
// error_log(x, 3, y): 3 = use y as write-to file
error_log('New Message At Top', 3, 'news.txt');
// Loop through the array we got from the first file() call and put each line back into the newly-recreated news.txt
foreach ($olddata as $line) {
error_log(trim($line), 3, 'news.txt');
}