title: How can I replace braces with <?php ?> in php file?
body: <p>I wanna replace braces with  <code>&lt;?php ?&gt;</code> in a file with php extension.
  I have a class as a library and in this class I have three function like these:</p>
  
  <pre><code> function replace_left_delimeter($buffer)
  {
      return($this-&gt;replace_right_delimeter(str_replace("{", "&lt;?php echo $", $buffer)));
  }
  
  function replace_right_delimeter($buffer)
  {
      return(str_replace("}", "; ?&gt; ", $buffer));
  }
  
  function parser($view,$data)
  {
      ob_start(array($this,"replace_left_delimeter"));
      include APP_DIR.DS.'view'.DS.$view.'.php';
      ob_end_flush();
  }
  </code></pre>
  
  <p>and I have a view file with php extension like this:</p>
  
  <pre><code>{tmp} tmpstr
  </code></pre>
  
  <p>in output I save just tmpstr and in source code in browser I get </p>
  
  <pre><code>&lt;?php echo $tmp; ?&gt; 
  tmpstr
  </code></pre>
  
  <p>In include file <code>&lt;?</code> shown as <code>&lt;!--?</code> and be comment. Why?</p>