将PHP文件生成静态文件源码

开心返利网   5i321网址导航

将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 ("生成成功");
?>

 

posted @ 2012-06-10 11:16  王国营的博客  阅读(258)  评论(0编辑  收藏  举报