<php>
$headers = get_headers('http://google.de');
echo "<pre>";
var_dump($headers);
echo "</pre>";
echo $response = substr($headers[0], 9, 3);
</php>
[0]=>
string(30) "HTTP/1.0 301 Moved Permanently"
[1]=>
string(31) "Location: http://www.google.de/"
[2]=>
string(38) "Content-Type: text/html; charset=UTF-8"
[3]=>
string(35) "Date: Tue, 03 May 2016 13:20:12 GMT"
[4]=>
string(38) "Expires: Thu, 02 Jun 2016 13:20:12 GMT"
[5]=>
string(38) "Cache-Control: public, max-age=2592000"
[6]=>
string(11) "Server: gws"
[7]=>
string(19) "Content-Length: 218"
[8]=>
string(31) "X-XSS-Protection: 1; mode=block"
[9]=>
string(27) "X-Frame-Options: SAMEORIGIN"
[10]=>
string(15) "HTTP/1.0 200 OK"
[11]=>
string(35) "Date: Tue, 03 May 2016 13:20:12 GMT"
[12]=>
string(11) "Expires: -1"
[13]=>
string(33) "Cache-Control: private, max-age=0"
[14]=>
string(43) "Content-Type: text/html; charset=ISO-8859-1"
[15]=>
string(114) "P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info.""
[16]=>
string(11) "Server: gws"
[17]=>
string(31) "X-XSS-Protection: 1; mode=block"
[18]=>
string(27) "X-Frame-Options: SAMEORIGIN"
[19]=>
string(223) "Set-Cookie: NID=79=Xqo8h2r62eW5aHXIVSMlyOakWhPypYhOZI7IkcJqnRwTDwOSjOdXG14G3C0NKv_lhFpvp3dlAhFoWRUM5CUi2-JkfFjW1YncL0Gc7_d3K42sbKWh7eDrEdx7gCtuCGZf; expires=Wed, 02-Nov-2016 13:20:12 GMT; path=/; domain=.google.de; HttpOnly"
[20]=>
string(95) "Set-Cookie: CONSENT=CG.253010; expires=Fri, 03-Jun-2016 13:20:12 GMT; path=/; domain=.google.de"
[21]=>
string(19) "Accept-Ranges: none"
[22]=>
string(21) "Vary: Accept-Encoding"
}
301