Difference between ob_get_clean and ob_get_flush

前端 未结 4 1595
野性不改
野性不改 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 09:02

    ob_get_clean() removes the buffer (without printing it), and returns its content.

    ob_get_flush() prints the buffer, removes it, and returns its content.

    Both function will terminate the buffer.

提交回复
热议问题