public static function extract($line)
    {
        $e = explode(': ', $line, 2);
        $header = strtolower(trim($e[0]));
        $value = isset($e[1]) ? trim($e[1]) : null;
        $safe = false;

        foreach (self::$safeCaseValues as $item) {
            if (strncasecmp($header, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
            if (strncasecmp($value, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
        }

        if (!$safe) {
            $value = strtolower($value);
        }

        return [$header, $value];
    }
public static function extract($line)
    {
        $e = explode(': ', $line, 2);
        $header = strtolower(trim($e[0]));
        $value = isset($e[1]) ? trim($e[1]) : null;
        $safe = false;

        foreach (self::$safeCaseValues as $item) {
            if (strncasecmp($header, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
            if (strncasecmp($value, $item, mb_orig_strlen($item)) === 0) {
                $safe = true;
                break;
            }
        }

        if (!$safe) {
            $value = strtolower($value);
        }

        return [$header, $value];
    }
public static function extract ( $ line ) { $ e = explode ( ': ' , $ line , 2 ) ; $ header = strtolower ( trim ( $ e [ 0 ] ) ) ; $ value = isset ( $ e [ 1 ] ) ? trim ( $ e [ 1 ] ) : null ; $ safe = false ; foreach ( self :: $ safeCaseValues as $ item ) { if ( strncasecmp ( $ header , $ item , mb_orig_strlen ( $ item ) ) === 0 ) { $ safe = true ; break ; } if ( strncasecmp ( $ value , $ item , mb_orig_strlen ( $ item ) ) === 0 ) { $ safe = true ; break ; } } if ( ! $ safe ) { $ value = strtolower ( $ value ) ; } return [ $ header , $ value ] ; }
Extract key and value pair from line.
@param  string $line
@return array
Extract key and value pair from line .