//设置参数 $title='标题'; //preg_replace_callback() //引入模板 $html=file_get_contents('./view/album.html'); //替换标签 $html = preg_replace('#/{tags/}#','<?php echo $title ?>', $html); //缓存保存 file_put_contents(TEMP."album.php",$html); //包含文件 include_once TEMP."album.php";