private function setHeaders($headers) {
        // Make array of the different headers
        $headers = explode(PHP_EOL, $headers);

        foreach ($headers as $header) {
            // Cut the header into pieces
            $header = explode(': ', $header);

            // Skip header if it's not in the default format
            if (!is_array($header) && count($header) === 1) {
                continue;
            }

            // Get the header type
            $type = strtolower(array_shift($header));

            // Glue the header back together
            $value = implode(': ', $header);

            // Skip header if the type or value is empty
            if (empty($type) || empty($value)) {
                continue;
            }

            // Store the header
            $this->headers[$type] = trim($value);
        }
    }
private function setHeaders($headers) {
        // Make array of the different headers
        $headers = explode(PHP_EOL, $headers);

        foreach ($headers as $header) {
            // Cut the header into pieces
            $header = explode(': ', $header);

            // Skip header if it's not in the default format
            if (!is_array($header) && count($header) === 1) {
                continue;
            }

            // Get the header type
            $type = strtolower(array_shift($header));

            // Glue the header back together
            $value = implode(': ', $header);

            // Skip header if the type or value is empty
            if (empty($type) || empty($value)) {
                continue;
            }

            // Store the header
            $this->headers[$type] = trim($value);
        }
    }
private function setHeaders ( $ headers ) { // Make array of the different headers $ headers = explode ( PHP_EOL , $ headers ) ; foreach ( $ headers as $ header ) { // Cut the header into pieces $ header = explode ( ': ' , $ header ) ; // Skip header if it's not in the default format if ( ! is_array ( $ header ) && count ( $ header ) === 1 ) { continue ; } // Get the header type $ type = strtolower ( array_shift ( $ header ) ) ; // Glue the header back together $ value = implode ( ': ' , $ header ) ; // Skip header if the type or value is empty if ( empty ( $ type ) || empty ( $ value ) ) { continue ; } // Store the header $ this -> headers [ $ type ] = trim ( $ value ) ; } }
Parse and store the headers

@param   string  $headers
Parse and store the headers