<?PHP// This is template_reader.php$var = "hello, world!";$str = file_get_contents("template.tpl");$str = str_replace("{{PLACEHOLDER}}",$var,$str);echo $str;?>--- New file;<?PHP// This is template.tpl. It is a PHP file.echo "{{PLACEHOLDER}}";?>--- This is the output:<?PHP// This is template.tpl. It is a PHP file.echo "hello, world!";?>// ALTERNATELY, the template file can be something other than PHP, for example, here's some html:<html><body><h1>{{PLACEHOLDER}}</h1></body></html>// And the output from that would be:<html><body><h1>hello, world!</h1></body></html>