public static function headersFromLines($lines)
    {
        $headers = [];

        foreach ($lines as $line) {
            $parts = explode(':', $line, 2);
            $headers[trim($parts[0])][] = isset($parts[1])
                ? trim($parts[1])
                : null;
        }

        return $headers;
    }
public static function headersFromLines($lines)
    {
        $headers = [];

        foreach ($lines as $line) {
            $parts = explode(':', $line, 2);
            $headers[trim($parts[0])][] = isset($parts[1])
                ? trim($parts[1])
                : null;
        }

        return $headers;
    }
public static function headersFromLines ( $ lines ) { $ headers = [ ] ; foreach ( $ lines as $ line ) { $ parts = explode ( ':' , $ line , 2 ) ; $ headers [ trim ( $ parts [ 0 ] ) ] [ ] = isset ( $ parts [ 1 ] ) ? trim ( $ parts [ 1 ] ) : null ; } return $ headers ; }
Parses an array of header lines into an associative array of headers.

@param array $lines Header lines array of strings in the following
format: "Name: Value"
@return array
Parses an array of header lines into an associative array of headers .