如果不打开缓冲区,则php输入一个内容就传给apche,如果打开了缓冲,则全部完了再输出
我们在php最后,读缓冲区,就是本页的输出内容
ob_start();打开缓冲区
读取缓冲区的内容ob_get_content();
清空缓冲区:ob_clean()
连读带清空ob_get_clean()
可以把读出的内容存到一个静态页面中
if(file_exists('./html/02.html')){
header('location:./html/02.html');
}
ob_start();//扛开缓冲区
echo 'a';
echo 'b';
$html=ob_get_contents();
ob_clean();
file_put_content('./html/02.html',$html);