Is there a smart way to check whether output has already been sent to the browser and sending a header would generate a PHP_WARNING?
Obviously there's the alternative of using an output buffer, but that's not always an option.
You can use the headers_sent() method. This because before anything is outputted, the headers will be send first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With