title: Including template file in PHP and replacing variables
body: <p>I have a .tpl file which contains the HTML code of my webpage and a .php file that I want to use the HTML code in it and replace some variables.
  For example imagine this is my file.tpl:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;{page_title}&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Welcome to {site_name}!
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and I want to define <code>{page_title}</code> and <code>{site_name}</code> in my php file and display them.</p>
  
  <p>One way we can do this is to load the page code in a variable and then replace <code>{page_title}</code> and <code>{site_name}</code> and then echo them.</p>
  
  <p>But I don't know that it's the best way or not because I think there will be some problem if the .tpl file is large.</p>
  
  <p>Please help me to find the best way. Thanks :-)</p>