您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP读写文件生成HTML的方法

2024/5/12 14:42:10发布22次查看
<?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 -- 把整个文件读入一个数组中
以上就是php读写文件生成html的方法的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product