Home > Backend Development > PHP Tutorial > Example of the simplest way to generate a static HTML page with PHP, static is the simplest_PHP tutorial

Example of the simplest way to generate a static HTML page with PHP, static is the simplest_PHP tutorial

WBOY
Release: 2016-07-13 09:57:32
Original
959 people have browsed it

Example of the simplest way to generate a static HTML page with PHP, static is the simplest

PHP file name: dome.php
Copy code The code is as follows:
$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();
?>

Template file name: templets/list.html
Copy code The code is as follows:




Insert title here









User: {counent_user} Title: {counent_title} Release time: {counent_lastdate}
Content: {counent_content}



www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/981358.htmlTechArticleExample of the simplest way to generate a static HTML page with PHP, the simplest static PHP file name: dome.php Copy the code as follows : php $string = 1; ob_start(); @readfile("templets/list.html"); $text...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template