If an HTTP Redirect is encountered, the headers will contain the response line and headers for all requests encountered. Consider this example:
<?php
file_get_contents("https://httpbin.org/redirect-to?url=https%3A%2F%2Fhttpbin.org%2F");
var_dump($http_response_header);
?>
Produces the following:
array(23) {
[0]=>
string(18) "HTTP/1.1 302 FOUND"
[1]=>
string(17) "Connection: close"
[2]=>
string(22) "Server: meinheld/0.6.1"
[3]=>
string(35) "Date: Tue, 06 Feb 2018 11:21:21 GMT"
[4]=>
string(38) "Content-Type: text/html; CHARSET=gb2312"
[5]=>
string(17) "Content-Length: 0"
[6]=>
string(30) "Location: https://httpbin.org/"
[7]=>
string(30) "Access-Control-Allow-Origin: *"
[8]=>
string(38) "Access-Control-Allow-Credentials: true"
[9]=>
string(19) "X-Powered-By: Flask"
[10]=>
string(34) "X-Processed-Time: 0.00107908248901"
[11]=>
string(14) "Via: 1.1 vegur"
[12]=>
string(15) "HTTP/1.1 200 OK"
[13]=>
string(17) "Connection: close"
[14]=>
string(22) "Server: meinheld/0.6.1"
[15]=>
string(35) "Date: Tue, 06 Feb 2018 11:21:21 GMT"
[16]=>
string(38) "Content-Type: text/html; CHARSET=gb2312"
[17]=>
string(21) "Content-Length: 13011"
[18]=>
string(30) "Access-Control-Allow-Origin: *"
[19]=>
string(38) "Access-Control-Allow-Credentials: true"
[20]=>
string(19) "X-Powered-By: Flask"
[21]=>
string(34) "X-Processed-Time: 0.00848388671875"
[22]=>
string(14) "Via: 1.1 vegur"
}