gpt4 book ai didi

php - ob_clean 和 ob_flush 之间的区别?

转载 作者:IT王子 更新时间:2023-10-29 01:05:54 32 4
gpt4 key购买 nike

ob_clean()ob_flush() 有什么区别?

此外,ob_end_clean()ob_end_flush() 之间有什么区别?我知道 ob_get_clean()ob_get_flush() 都获取内容并结束输出缓冲。

最佳答案

*_clean 变体只是清空缓冲区,而 *_flush 函数打印缓冲区中的内容(将内容发送到输出缓冲区)。

示例:

ob_start();
print "foo"; // This never prints because ob_end_clean just empties
ob_end_clean(); // the buffer and never prints or returns anything.

ob_start();
print "bar"; // This IS printed, but just not right here.
ob_end_flush(); // It's printed here, because ob_end_flush "prints" what's in
// the buffer, rather than returning it
// (unlike the ob_get_* functions)

关于php - ob_clean 和 ob_flush 之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8770910/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com