php里面添加html文件,很多時(shí)候需要用到!

10年積累的做網(wǎng)站、成都網(wǎng)站制作經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站設(shè)計(jì)后付款的網(wǎng)站建設(shè)流程,更有臨澧免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
如添加一個(gè)站點(diǎn)統(tǒng)計(jì)到網(wǎng)站,如果你的網(wǎng)站全部是php來(lái)寫(xiě)的,這時(shí)候直接用echo輸出統(tǒng)計(jì)代碼就會(huì)出現(xiàn)問(wèn)題!然后php可以很方便的引入一個(gè)html文件,這樣就方便多了!
具體操作如下:
在do_footer函數(shù)里面利用include即可導(dǎo)入一個(gè)html文件
1)修改do_footer函數(shù)
function do_footer($credits = true) {
global $globals;
echo "/div!–#container closed–\n";
include("hugwww-footer.html");
if($credits) @do_credits();
do_js_from_array($globals['post_js']);
// warn warn warn
// dont do stats of password recovering pages
@include(‘a(chǎn)ds/stats.inc’);
printf("\n!–Generated in %4.3f seconds–\n", microtime(true) – $globals['start_time']);
2)將統(tǒng)計(jì)代碼寫(xiě)入hugwww-footer.html文件完成!
$result = mysql_query("SELECT * FROM table_name");
while($row = mysql_fetch_array($result))
{
echo $row['ID'] . " " . $row['xuehao'] . " " . $row['xingming'] . " " . $row['chengji1'] . " " . $row['chengji2'];
echo "br /";
}
PHP寫(xiě)入HTML文件可以使用file_put_contents,例如:
file_put_contents('a.html', "html
bodyhello/body
/html");
PHP訪問(wèn)HTML文件可以使用readfile、file等,例如:
readfile('a.html');
本文標(biāo)題:php將數(shù)據(jù)寫(xiě)入html,php 寫(xiě)入文件
當(dāng)前地址:http://chinadenli.net/article11/dsededd.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號(hào)、營(yíng)銷(xiāo)型網(wǎng)站建設(shè)、全網(wǎng)營(yíng)銷(xiāo)推廣、外貿(mào)建站、虛擬主機(jī)、云服務(wù)器
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)