function makehtml($file_str,$file_name,$file_path){
$file_url=$file_path."/".$file_name.".html";
$fp=fopen($file_url,"w+");
fputs($fp,"$file_str");
fclose($fp);
return(file_exists($file_url));
}
$file_url=$file_path."/".$file_name.".html";
$fp=fopen($file_url,"w+");
fputs($fp,"$file_str");
fclose($fp);
return(file_exists($file_url));
}
$file_name,文件名
$file_path文件存放路径
这个只是生成html文件的!
ob_start();//打开缓冲区
?>
php页面的全部输出
<?
$content = ob_get_contents();//取得php页面输出的全部内容
$fp = fopen(“output00001.html”, “w”); //创建一个文件,并打开,准备写入
fwrite($fp, $content); //把php页面的内容全部写入output00001.html,然后……
fclose($fp);
?>
$filename = "http://www.sohu.com";
$html=file_get_contents($filename);
echo $html;
?>