DudeOnRock
DudeOnRock

Reputation: 3831

What content-type header has been set?

How can I find out if this header: header('Content-Type: application/json') has been set during script execution? `

Upvotes: 2

Views: 91

Answers (2)

phpisuber01
phpisuber01

Reputation: 7715

You can use either headers_sent or headers_list to determine if the headers were sent and which ones respectively.

Upvotes: 1

George Cummins
George Cummins

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

Related Questions