Good afternoon, I drew a problem, there is

File menu.php in it php code

echo"1"; 

Fail index.php in it:

 $templete_site=file_get_contents('template.php'); while ($row_templete=mysql_fetch_array($res_templete)) { $templete_site=str_replace("{".$row_templete[name_variables]."}", "$row_templete[php_variables]", "$templete_site");} echo $templete_site; 

Fail template.php in it html code with php inserts php inserts do not work

in template.php

 .... <div id="telefon">(4852) {telefon}</div> <div id="header_menu"> <a href=""><img src="{site_full}images/menu_home.png" width="44" height="46" border="0"></a> <div id="header_menu_all"> <?include('menu_top.php');?><a href="">Главная</a> <a href="">О нас</a> <a href="">Контакты</a> </div> </div> ..... 

Question: how to make everything work so that replacements ( {site_full} ) and php inserts work too ...
ATP in advance

    2 answers 2

     $templete_site = str_replace( "{".$row_templete['name_variables']."}", $row_templete['php_variables'], $templete_site ); 

    Remove quotes from the second and third parameters.

      Well, do eval instead of echo but really nobody does. If inserts then inserts, if php, then why do you need a template engine?