+1  A: 

By checking the return value of headers_sent()

if(!headers_sent())
Chacha102
+2  A: 

Use the boolean-returning function headers_sent to determine if headers have been fully sent (implying that some content has also been sent too).

Delan Azabani