PHP code example of dcarbone / curl-header-extractor

1. Go to this page and download the library: Download dcarbone/curl-header-extractor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dcarbone / curl-header-extractor example snippets


array(
    // array of headers,
    // string of body content
);

list($headers, $body) = \DCarbone\CURLHeaderExtractor::getHeaderAndBody($input);

array(
    // array of headers,
    // integer representing the byte offset of the beginning of the body
);

list($headers, $bodyByteOffset) = \DCarbone\CURLHeaderExtractor::extractHeadersAndBodyStartOffset($input);

\DCarbone\CURLHeaderExtractor::removeHeadersAndMoveFile($file, 'my_new_filename.ext');

$extractor = new \DCarbone\CURLHeaderExtractor();

list($headers, $body) = $extractor($input);

list($headers, $bodyByteOffset) = $extractor::extractHeadersAndBodyStartOffset($input);