Parse an HTTP response message into an associative array of parts.
string $message HTTP response to parse:
array|bool Returns false if the message is invalid
Overrides MessageParserInterface::parseResponse
public function parseResponse($message) {
if (!$message) {
return false;
}
$parts = $this
->parseMessage($message);
list($protocol, $version) = explode('/', trim($parts['start_line'][0]));
return array(
'protocol' => $protocol,
'version' => $version,
'code' => $parts['start_line'][1],
'reason_phrase' => isset($parts['start_line'][2]) ? $parts['start_line'][2] : '',
'headers' => $parts['headers'],
'body' => $parts['body'],
);
}