PHP生成静态HTML页面最简单方法示例
PHP生成静态HTML页面最简单方法来分享给大家,跟随小编去看看吧!
PHP文件名:dome.php
复制代码 代码如下:
<?php
$string = 1;
ob_start();
@readfile("templets/list.html");
$text = ob_get_flush();
$myfile = fopen("list.html","w");
$text = str_replace ("{counent}",$string,$text);
fwrite($myfile,$text);
ob_clean();
?>
模板文件名:templets/list.html
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-/pic/pic/pic/pic/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
</body>
<table width="500" border="0" cellpadding="5" cellspacing="1" align="center" bgcolor="#add3ef">
<tr bgcolor="#eff3ff">
<td>用户:{counent_user} 标题:{counent_title} 发布时间:{counent_lastdate}</td>
</tr>
<tr bgcolor="#fff">
<td>内容:{counent_content}</td>
</tr>
</table>
</form>
</html></p
【PHP生成静态HTML页面最简单方法示例】相关文章:
生成PHP网站页面静态化的方法01-09
php技术生成静态页面的方法12-25
如何生成静态页面的PHP类10-03
php生成静态页面的详细教程12-29
php生成WML页面方法12-11
php静态页生成方法03-11
php动态网页怎么转换成html静态页面12-13
PHP延迟静态绑定示例分享03-01