Splits an HTTP response status line into components.
See the status line definition in RFC 2616.
string $respone: The response status line, for example 'HTTP/1.1 500 Internal Server Error'.
array Keyed array containing the component parts. If the response is malformed, all possible parts will be extracted. 'reason_phrase' could be empty. Possible keys:
function _drupal_parse_response_status($response) {
$response_array = explode(' ', trim($response), 3);
// Set up empty values.
$result = array(
'reason_phrase' => '',
);
$result['http_version'] = $response_array[0];
$result['response_code'] = $response_array[1];
if (isset($response_array[2])) {
$result['reason_phrase'] = $response_array[2];
}
return $result;
}