Problem
You want to write content to the end of a file.
Solution
Use the File::append() method.
$bytesWritten = File::append($filename, $content);
if ($bytesWritten === false)
{
die("Couldn't write to the file.");
}
This will add the content to the end of existing files. If the file doesn't exist then the entire contents will be $content.
Discussion
Watch the return value.
If there's a problem writing to the file false is returned.
