<?php
//生成HTML
$countfile="template.html";
$num=file_get_contents($countfile);
echo $num;
$num=str_replace("|*|*|PAGE_TITLE|*|*|","myhome",$num);
$path="template.html";
$handle=fopen($path,"w"); //写入方式打开新闻路径
fwrite($handle,$num); //把刚才替换的内容写进生成的HTML文件
fclose($handle);
?>
file_get_contents -- 将整个文件读入一个字符串
file -- 把整个文件读入一个数组中
//生成HTML
$countfile="template.html";
$num=file_get_contents($countfile);
echo $num;
$num=str_replace("|*|*|PAGE_TITLE|*|*|","myhome",$num);
$path="template.html";
$handle=fopen($path,"w"); //写入方式打开新闻路径
fwrite($handle,$num); //把刚才替换的内容写进生成的HTML文件
fclose($handle);
?>
file_get_contents -- 将整个文件读入一个字符串
file -- 把整个文件读入一个数组中
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“PHP读写文件的方法(生成HTML)”评论...