PHP 输出控制函数

PHP ob_flush() 函数刷新输出缓冲区的内容。此函数不会像 ob_end_flush() 那样破坏输出缓冲区。

语法

ob_flush() 

参数

不需要参数。

返回值

成功时返回 true,失败时返回 false

示例:ob_flush() 示例

下面的示例显示了ob_flush() 函数的用法。

<?php
//打开输出缓冲
ob_start();

echo "This content will be cleaned from the output buffer.";

//清除输出缓冲区
ob_clean();

echo "New content is added to the output buffer.";

//刷新输出缓冲区
ob_flush();

//清除输出缓冲区并将其关闭
ob_end_clean();
?> 

上述代码的输出将是:

New content is added to the output buffer.