Library/Think/Environment.class.php
/**
     * Extract HTTP headers from an array of data (e.g. $_SERVER)
     * @param  array   $data
     * @return array
     */
Extract HTTP headers from an array of data
@param  array   $data
@return array
Extract HTTP headers from an array of data @param array $data @return array
protected static function extract($data) {
        $results = [];
        foreach ($data as $key => $value) {
            $key = strtoupper($key);
            if (strpos($key, 'X_') === 0 || strpos($key, 'HTTP_') === 0 || in_array($key, static::$special)) {
                if ($key === 'HTTP_CONTENT_LENGTH') {
                    continue;
                }
                $results[$key] = $value;
            }
        }
        return $results;
    }
protected static function extract ( $ data ) { $ results = [ ] ; foreach ( $ data as $ key => $ value ) { $ key = strtoupper ( $ key ) ; if ( strpos ( $ key , 'X_' ) === 0 || strpos ( $ key , 'HTTP_' ) === 0 || in_array ( $ key , static :: $ special ) ) { if ( $ key === 'HTTP_CONTENT_LENGTH' ) { continue ; } $ results [ $ key ] = $ value ; } } return $ results ; }
Extract HTTP headers from an array of data (e.g.
Extract HTTP headers from an array of data ( e . g .