public function parseResponse($message)
    {
        if (!($parts = $this->parseMessage($message))) {
            return false;
        }

        list($protocol, $version) = explode('/', trim($parts['start_line'][0]));

        return [
            'protocol'         => $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']
        ];
    }
public function parseResponse($message)
    {
        if (!($parts = $this->parseMessage($message))) {
            return false;
        }

        list($protocol, $version) = explode('/', trim($parts['start_line'][0]));

        return [
            'protocol'         => $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']
        ];
    }
public function parseResponse ( $ message ) { if ( ! ( $ parts = $ this -> parseMessage ( $ message ) ) ) { return false ; } list ( $ protocol , $ version ) = explode ( '/' , trim ( $ parts [ 'start_line' ] [ 0 ] ) ) ; return [ 'protocol' => $ 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' ] ] ; }
Parse an HTTP response message into an associative array of parts.

@param string $message HTTP response to parse

@return array|bool Returns false if the message is invalid
Parse an HTTP response message into an associative array of parts .