In PHP file, get {$variable} to do the equivalent of <?php echo $variable; ?>
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3930053/dirt-simple-php-templates-can-this-work-without-eval">Dirt-simple PHP templates&hellip; can this work without <code>eval</code>?</a>  </p>
</blockquote>



<p>Let's say I have a text file called <code>template.tpl</code>.  The contents of <code>template.tpl</code> is:</p>

<pre><code>&lt;html&gt;
&lt;body&gt;This is a variable: {$variable}&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Is there a way for PHP to render template.tpl as a PHP file and then understand that <code>{$variable}</code> should be processed as <code>&lt;?php echo $variable; ?&gt;</code>?</p>
