ob_end_clean(); 
ob_start(); 
include("index.php");
$info = ob_get_contents();
$fp = fopen("index.html", "w");
fwrite($fp, $info); 
ob_end_clean();
fclose($fp); 写入到index.html 后乱码 index.php是UTF-8编码

解决方案 »

  1.   

    index.html是什么编码
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    是这个么
    还是你本身include("index.php");输出有问题
    -------------------------------------------------
    新型ORM queryphp框架简介和教程入门
    http://topic.csdn.net/u/20100222/16/b31eaaf2-4ac6-4238-898b-4f06dd3dfbe5.html
    下载
    http://code.google.com/p/queryphp/downloads/list
      

  2.   

    echo $info;  //这样有乱码么?
      

  3.   


    index.html 是程序创建的
    index.php 通过浏览器没问题 编码是UTF-8我就是把index.php动态内容生成html文件
      

  4.   

    把$info字符串转变utf-8再生成html文件
      

  5.   

    index.html文件里面有没有
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 还是gb2312编码
    -------------------------------------------------
    新型ORM queryphp框架简介和教程入门
    http://topic.csdn.net/u/20100222/16/b31eaaf2-4ac6-4238-898b-4f06dd3dfbe5.html
    下载
    http://code.google.com/p/queryphp/downloads/list 
      

  6.   


    喔加了这句header("Content-Type: text/html; charset=utf-8"); 就没乱码了