PHP: isset for buffer?

Is there a method like isset, so I can determine if there is a buffer to delete / clean?

Note: ob_end_flush (): Failed to delete and reset the buffer. There is no buffer to remove or clean.

I do not transmit the error message with the highest sensitivity, since it is very uncertain if you think a lot. So how can I hide this problem?

+4
source share
2 answers

Look at ob_get_level and / or ob_get_status .

+4
source

Take a look at ob_list_handlers . If it returns an empty array, you are not buffering the output.

EDIT: Or ob_get_level - maybe better, but I haven't seen this the first time: p

+1
source

Source: https://habr.com/ru/post/1395996/


All Articles