$view=file_get_contents('./a.tpl'); //新闻详情页模板模式,需要数据位置定义标签如{title},{content} $php_content=str_replace("{title}",'标题',$view); //用动态数据替换掉模板位置标签 $php_content=str_replace("{content}",'内容',$php_content); file_put_contents('./a.html',$php_content);//生成静态页
$view=file_get_contents('./a.tpl'); //新闻详情页模板模式,需要数据位置定义标签如{title},{content} $php_content=str_replace("{title}",'标题',$view); //用动态数据替换掉模板位置标签 $php_content=str_replace("{content}",'内容',$php_content); file_put_contents('./a.html',$php_content);//生成静态页
转载于:https://www.cnblogs.com/houweijian/p/3569612.html