Difference between ob_get_clean and ob_get_flush

前端 未结 4 1603
野性不改
野性不改 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:52

    ob_get_clean will just return the contents of the buffer and assign it to whatever variable you want it to, but it will not output anything.

    ob_get_flush on the other hand, does everything that ob_get_clean does, but it also outputs the content.

提交回复
热议问题