Home > php教程 > php手册 > body text

PHP生成静态HTML页面最简单方法示例,静态最简

WBOY
Release: 2016-06-13 09:07:18
Original
1027 people have browsed it

PHP生成静态HTML页面最简单方法示例,静态最简

PHP文件名:dome.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
复制代码 代码如下:




Insert title here



 
   
 
 
   
 
用户:{counent_user}  标题:{counent_title}  发布时间:{counent_lastdate}
内容:{counent_content}



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!