If you have xdebug installed you can use xdebug_get_headers() to get the headers. Then you can test them as needed.
$headers=xdebug_get_headers();
gets you an array which looks like...
array(
0 => "Content-type: text/html",
1 => ...
)
So you'll need to parse each header line to separate the header name from the value
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…