ob_start — Turn on output buffering
说明
bool ob_start ( [callback $output_callback [, int $chunk_size [, bool $erase]]] )
返回值
如果成功则返回 TRUE,失败则返回 FALSE。
更新日志
范例
例 1633. User defined callback function example
<?php
function callback($buffer)
{
// replace all the apples with oranges
return (str_replace("apples",
"oranges",
$buffer));
}
ob_start("callback");
?>
<html>
<body>
<p>It's like comparing apples to oranges.</p>
</body>
</html>
<?php
ob_end_flush();
?>
上例将输出:
<html> <body> <p>It's like comparing oranges to oranges.</p> </body> </html>