Putting data from 3 text files into 3 variables I have the following code, which gets the data from 3 text files and puts them into 3 variables. How can I refactor this to make it smaller?

$handle = fopen($template_filename, "r");
if (filesize($template_filename) &gt; 0)
{
    $email_template = fread($handle, filesize($template_filename));
}
fclose($handle);

// get the subject from a text file
$handle = fopen($subject_filename, "r");
if (filesize($subject_filename) &gt; 0)
{
    $subject_template = fread($handle, filesize($subject_filename));
}
fclose($handle);

// get the footer from a text file
$handle = fopen($footer_filename, "r");
if (filesize($footer_filename) &gt; 0)
{
    $footer_template = fread($handle, filesize($footer_filename));
}
fclose($handle);
For one thing, you can use file_get_contents:

$email_template = file_get_contents($template_filename);
$subject_template = file_get_contents($subject_filename);
$footer_template = file_get_contents($footer_filename);