php 生成静态页面函数

时间:2022-09-29 23:13:02

生成页面函数

 /**
* 生成页面函数
* $set_path 保存路径
* $set_name 保存的文件名
* $set_con 保存的内容
*/


public function set_up($set_path,$set_name,$set_con)
{

//$set_path = 'application/admin/controller/';
//$set_name = 'trees.html ';//文件名及路径,在当前目录下新建aa.txt文件
$fopen=fopen($set_path.$set_name, 'wb');//新建文件命令

fputs($fopen, $set_con);//向文件中写入内容;
fclose($fopen);
exit;
}