PHP: get_headers set temporary stream_context
问题 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 other requests on the page. I can't seem to figure out how to reset the default stream context. I'm trying something like: $default = stream_context_get_default(); //Get default stream context so we can reset it stream_context_set_default( //Only fetch the HEAD array( 'http' => array( 'method' => 'HEAD' ) ) ); $headers = get