将PHP文件生成静态文件源码
将PHP文件转换成静态文件,这样就不用频繁读取数据库了,打开速度也会快很多
<?php
function mhtml($url,$fileName){
$Content=file_get_contents($url);
$fp = @fopen($fileName, "w+");
@fwrite($fp, $Content);
fclose($fp);
}
mhtml("http://yourdomain/index.php","index.htm");
echo ("生成成功");
?>
function mhtml($url,$fileName){
$Content=file_get_contents($url);
$fp = @fopen($fileName, "w+");
@fwrite($fp, $Content);
fclose($fp);
}
mhtml("http://yourdomain/index.php","index.htm");
echo ("生成成功");
?>