You can read the template file into one string
using [man]file_get_contents/man
If you know the template filename it is very easy:
<?php
$string = file_get_contents( $template_filename );
// do the string replace on $string
// echo the new string as a page
?>