微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PHP ob_start()问题

我允许有两个或更多ob_start();在我的PHP文件中,如果是这样,结束一个ob_start()的正确方法是什么;并开始另一个

解决方法:

从手册:

Output buffers are stackable, that is,
you may call ob_start() while another
ob_start() is active. Just make sure
that you call ob_end_flush() the
appropriate number of times. If
multiple output callback functions are
active, output is being filtered
sequentially through each of them in
nesting order.

除了堆叠(嵌套)之外,您还可以按顺序使用单独的块.

<?
ob_start();
echo "Foo";
ob_end_flush(); // outputs buffer contents and turns off output buffering

ob_start();
echo "Bar";
ob_end_flush();
?>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐