private function setHeaderOutput($curlResource, array &$output)
    {
        curl_setopt($curlResource, CURLOPT_HEADERFUNCTION, function($resource, $headerString) use (&$output) {
            $header = trim($headerString, "\n\r");
            if (strlen($header) > 0) {
                $output[] = $header;
            }
            return mb_strlen($headerString, '8bit');
        });
    }
private function setHeaderOutput($curlResource, array &$output)
    {
        curl_setopt($curlResource, CURLOPT_HEADERFUNCTION, function($resource, $headerString) use (&$output) {
            $header = trim($headerString, "\n\r");
            if (strlen($header) > 0) {
                $output[] = $header;
            }
            return mb_strlen($headerString, '8bit');
        });
    }
private function setHeaderOutput ( $ curlResource , array & $ output ) { curl_setopt ( $ curlResource , CURLOPT_HEADERFUNCTION , function ( $ resource , $ headerString ) use ( & $ output ) { $ header = trim ( $ headerString , "\n\r" ) ; if ( strlen ( $ header ) > 0 ) { $ output [ ] = $ header ; } return mb_strlen ( $ headerString , '8bit' ) ; } ) ; }
Setup a variable, which should collect the cURL response headers.
@param resource $curlResource cURL resource.
@param array $output variable, which should collection headers.
Setup a variable which should collect the cURL response headers .