<?php
ob_start();//开启缓存
/**
* 这里我们就开始真正的生成静态页面了
*/
?>
<?php
for ($i = 0; $i < 20; $i++)
{
echo "$i/n/r<br />";
}
//这里就把for循环里的数据缓存起来了 因为上面我们ob_start了的
?>
<?php
$content = ob_get_contents();
$fp = fopen('test5.html', "w");
fwrite($fp, $content);
fclose($fp);
ob_end_clean();
//ok