title: How to make a php template engine?
body: <p>I need to make a small and simple php template engine I searched a lot and many of them were too complex to understand and I don't want to use smarty and other similar engines, I have got some idea from Stack Overflow like this: </p>
  
  <pre><code>$template = file_get_contents('file.html');
  $array = array('var1' =&gt; 'value',
                  'txt' =&gt; 'text');
  
  foreach($array as $key =&gt; $value)
  {
    $template = str_replace('{'.$key.'}', $value, $template);
  }
  
  echo $template;
  </code></pre>
  
  <p>Now instead of echo the template I just want to add include "file.html" and it will display the file with correct variable values and I want to put the engine in a separate place and just include it in the template what I want to use it declare the array and at the end include the html file like phpbb. Sorry I am asking to much but can anyone just explain the basic concept behind this?</p>
  
  <p>EDIT: Well let me be frank i am making a forum script and i have got tons of ideas for it but i want make its template system like phpbb so i need a separate template engine custom one if you can help then please you are invited to work with me. sorry for the ad.. :p</p>