drvlf9739 2011-07-26 13:34
浏览 20
已采纳

回声语句没有正确刷新?

I've been trying to debug this code for hours now, but haven't been making any headway. My print statements are simply not working. Another question suggested I flush(), but it's not working.

echo 'this never prints';
flush();
flush();
flush();

Any help would be appreciated.

  • 写回答

3条回答 默认 最新

  • dt250827 2011-07-27 07:18
    关注

    If you are inside an outbut buffer, which you can check with ob_get_level()>0, you can flush contents with ob_flush(). If you want to break out of all outbut buffers, this is a quick oneliner to end them all:

    while(ob_get_level()>0) ob_end_flush();
    

    Possibly use ob_end_clean() instead of ob_end_flush() if you want to discard the buffer(s).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部