Use case for output buffering as the correct solution to “headers already sent”

前端 未结 5 575
无人及你
无人及你 2020-12-11 17:10

I see (not just on this site) a lot of question from inexperienced PHP programmers about the infamous \"headers already sent... output started at\" error, and many people su

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 17:54

    You might want to issue HTTP redirects late in the flow, for example in templates or exception handling. (Of course, a framework with templating or global exception handling would need output buffering anyway, so you could say it isn't a solution to this problem specifically.)

提交回复
热议问题