PHP產生靜態HTML頁面簡單方法 html程式碼 html5 教學 html 空格

WBOY
發布: 2016-07-29 08:51:17
原創
1248 人瀏覽過

PHP檔名:dome.php

<code><span><?php</span><span>$string</span> = <span>1</span>;
    ob_start();
    @readfile(<span>"templets/list.html"</span>);
    <span>$text</span> = ob_get_flush();
    <span>$myfile</span> = fopen(<span>"list.html"</span>,<span>"w"</span>);
    <span>$text</span> = str_replace (<span>"{counent}"</span>,<span>$string</span>,<span>$text</span>);
    fwrite(<span>$myfile</span>,<span>$text</span>);
    ob_clean();
<span>?></span></code>
登入後複製

模板檔名:templets/list.html

<code><span><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"></span><span><<span>html</span>></span><span><<span>head</span>></span><span><<span>meta</span><span>http-equiv</span>=<span>"Content-Type"</span><span>content</span>=<span>"text/html; charset=UTF-8"</span>></span><span><<span>title</span>></span>Insert title here<span></<span>title</span>></span><span></<span>head</span>></span><span><<span>body</span>></span><span></<span>body</span>></span><span><<span>table</span><span>width</span>=<span>"500"</span><span>border</span>=<span>"0"</span><span>cellpadding</span>=<span>"5"</span><span>cellspacing</span>=<span>"1"</span><span>align</span>=<span>"center"</span><span>bgcolor</span>=<span>"#add3ef"</span>></span><span><<span>tr</span><span>bgcolor</span>=<span>"#eff3ff"</span>></span><span><<span>td</span>></span>用户:{counent_user}  标题:{counent_title}  发布时间:{counent_lastdate}<span></<span>td</span>></span><span></<span>tr</span>></span><span><<span>tr</span><span>bgcolor</span>=<span>"#fff"</span>></span><span><<span>td</span>></span>内容:{counent_content}<span></<span>td</span>></span><span></<span>tr</span>></span><span></<span>table</span>></span><span></<span>form</span>></span><span></<span>html</span>></span></code>
登入後複製

http://blog.csdn.net/leedaning/article/details/48088863357 月'pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i

').text(i)); }; $numbering.fadeIn(1700); }); });
以上就介紹了PHP產生靜態HTML頁面簡單方法,包含了HTML方面的內容,希望對PHP教學有興趣的朋友有幫助。

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!