Home  >  Article  >  Backend Development  >  Simple method to generate static HTML page with PHP html code html5 tutorial html space

Simple method to generate static HTML page with PHP html code html5 tutorial html space

WBOY
WBOYOriginal
2016-07-29 08:51:171182browse

PHP file name: 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();
?>

Template file name: templets/list.html

<html><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><title>Insert title heretitle>head><body>body><tablewidth="500"border="0"cellpadding="5"cellspacing="1"align="center"bgcolor="#add3ef"><trbgcolor="#eff3ff"><td>用户:{counent_user}  标题:{counent_title}  发布时间:{counent_lastdate}td>tr><trbgcolor="#fff"><td>内容:{counent_content}td>tr>table>form>html>

http://blog.csdn.net/leedaning/article/details/48088863

').addClass( 'pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces a simple method for generating static HTML pages in PHP, including HTML content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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