I guess PHP\'s get_headers does not allow for a context, so I have to change the default stream context to only get the HEAD of a request. This causes some issues with othe
I had a similar issue but I just used the file_get_contents function with the custom stream context instead.
Here's how I implemented it:
$options = array(
'http' => array(
'method' => 'HEAD',
'follow_location' => 0
)
);
$context = stream_context_create($options);
@file_get_contents($url, NULL, $context);
var_dump($http_response_header);
Using this context only the headers will be fetched by file_get_contents and will populate the $http_response_header PHP variable.