public function prepareResponse($result)
    {
        $response = ['header' => null, 'content' => null];
        $d = "\r\n\r\n"; // Headers and content delimiter

        if (is_string($result) && strpos($result, $d) !== false) {
            list($header, $content) = explode($d, $result, 2);
            if (stripos($header, '100 Continue') !== false && strpos($content, $d) !== false) {
                list($header, $content) = explode($d, $content, 2);
            }
            $response['header'] = $header;
            $response['content'] = htmlentities($content);
        }

        return $response;
    }
public function prepareResponse($result)
    {
        $response = ['header' => null, 'content' => null];
        $d = "\r\n\r\n"; // Headers and content delimiter

        if (is_string($result) && strpos($result, $d) !== false) {
            list($header, $content) = explode($d, $result, 2);
            if (stripos($header, '100 Continue') !== false && strpos($content, $d) !== false) {
                list($header, $content) = explode($d, $content, 2);
            }
            $response['header'] = $header;
            $response['content'] = htmlentities($content);
        }

        return $response;
    }
public function prepareResponse ( $ result ) { $ response = [ 'header' => null , 'content' => null ] ; $ d = "\r\n\r\n" ; // Headers and content delimiter if ( is_string ( $ result ) && strpos ( $ result , $ d ) !== false ) { list ( $ header , $ content ) = explode ( $ d , $ result , 2 ) ; if ( stripos ( $ header , '100 Continue' ) !== false && strpos ( $ content , $ d ) !== false ) { list ( $ header , $ content ) = explode ( $ d , $ content , 2 ) ; } $ response [ 'header' ] = $ header ; $ response [ 'content' ] = htmlentities ( $ content ) ; } return $ response ; }
Process the result and split into headers and content

@param string|bool $result
@return array
Process the result and split into headers and content