现页面上都是php文件,现为了减轻php程序的压力,现想把str.php页面 转化成 str.html页面
下回调用str.php页面时,调用str.html页面时就可
怎么实现呀,thanks

解决方案 »

  1.   

    if(is_file(str.html)){
        include_once "str.html";
    }else{
        include_once "str.php";//注意第一次执行.php文件的时候.html文件一定要不存在
    }这个方法算是简单一点吧呵呵仅供参考
      

  2.   

    o shit==if(is_file('str.html')){ 
        include_once 'str.html'; 
    }else{
     include_once 'str.php';//注意第一次执行.php文件的时候.html文件一定要不存在
    }
      

  3.   

    把str.php页面 转化成 str.html页面?
      

  4.   

    应该是把抓到的数据生成一个html文件,减少数据库的压力和PHP程式的运行时间吧
      

  5.   

    google关键词:php  静态
      

  6.   

    我就知道用模板解析!模板解析类有phplib,smarty,fastsmarty。其他我就不知道了!惭愧!
      

  7.   

    <?php
    $file_name='str'; //文件名字
    $file_type_array=array('.html','.php','.htm','.jsp'); //可不断添加类型
    forwach($file_type_array as $key){
      if(is_file($file_name . $key)){
              include($file_name . $key);
              break;
          }
    }
    ?>
      

  8.   

    if(!file_exist("str.html")){
    $s=exec("php str.php > str.html");
    }
    include_once "str.html";
      

  9.   

    读一下phpcms 吧,哪里面应该有想要的代码