Reputation: 3831
How can I find out if this header: header('Content-Type: application/json')
has been set during script execution?
`
Upvotes: 2
Views: 91
Reputation: 7715
You can use either headers_sent
or headers_list
to determine if the headers were sent and which ones respectively.
Upvotes: 1
Reputation: 28936
headers_list() will return a list of headers to be sent to the browser / client. To determine whether or not these headers have been sent yet, use headers_sent().
Upvotes: 3