A simple demonstration of how PHP uses templates to generate static pages.
Template file templates.htm:
PHP file code:
$title = webjx;
$hello = webjxcom!;
$file = file_get_contents (templets.htm);
$file = str_replace(array({title},{hello}),array($ title,$hello), $file);
echo $file;
?>
http://www.bkjia.com/PHPjc/531688.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531688.htmlTechArticleA simple demonstration of how PHP uses templates to generate static pages. Template file templets.htm: html head title{title}/title /head body pHello {hello}/p /body /html PHP file code: ?php $tit...