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

php生成html文件的简单例子

2025/8/7 13:17:22发布56次查看
$val){ $title = $val[0]; $content = $val[1]; $path = $id.'.htm'; $fp = fopen(jia.htm, r); //打开文件,只读方式 $str = fread($fp, filesize(jia.htm)); //读取文件 $str = str_replace({title}, $title,$str); //将字符串中的内容进行替换 $str = str_replace({content}, $content, $str); fclose($fp); //关闭文件 $fpw = fopen($path, w); //以写入的方式打开文件 fwrite($fpw, $str); //将$str写入文件 fclose($fpw); echo generate successfully!;}?>
复制代码
该用户其它信息

VIP推荐

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