Difference between ob_get_clean and ob_get_flush

前端 未结 4 1632
野性不改
野性不改 2021-01-31 08:01

They both seem to do the same thing: return the output buffer content to you and delete it aftewards.

Which one should I use?

4条回答
  •  情深已故
    2021-01-31 08:46

    Both functions clear the output buffer, turn off output buffering, and return the previous buffer value.

    However, ob_get_flush first sends the current buffer to the client, whereas ob_get_clean just discards it.

提交回复
热议问题