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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the headers_sent() method. This because before anything is outputted, the headers will be send first.