public static function extractHeaderAttributes($headers, $prefix = NULL) {
    if (empty($prefix)) {
      $prefix = Container::METADATA_HEADER_PREFIX;
    }
    $attributes = array();
    $offset = strlen($prefix);
    foreach ($headers as $header => $value) {

      $index = strpos($header, $prefix);
      if ($index === 0) {
        $key = substr($header, $offset);
        $attributes[$key] = $value;
      }
    }
    return $attributes;
  }
public static function extractHeaderAttributes($headers, $prefix = NULL) {
    if (empty($prefix)) {
      $prefix = Container::METADATA_HEADER_PREFIX;
    }
    $attributes = array();
    $offset = strlen($prefix);
    foreach ($headers as $header => $value) {

      $index = strpos($header, $prefix);
      if ($index === 0) {
        $key = substr($header, $offset);
        $attributes[$key] = $value;
      }
    }
    return $attributes;
  }
public static function extractHeaderAttributes ( $ headers , $ prefix = NULL ) { if ( empty ( $ prefix ) ) { $ prefix = Container :: METADATA_HEADER_PREFIX ; } $ attributes = array ( ) ; $ offset = strlen ( $ prefix ) ; foreach ( $ headers as $ header => $ value ) { $ index = strpos ( $ header , $ prefix ) ; if ( $ index === 0 ) { $ key = substr ( $ header , $ offset ) ; $ attributes [ $ key ] = $ value ; } } return $ attributes ; }
Extract object attributes from HTTP headers.

When OpenStack sends object attributes, it sometimes embeds them in
HTTP headers with a prefix. This function parses the headers and
returns the attributes as name/value pairs.

Note that no decoding (other than the minimum amount necessary) is
done to the attribute names or values. The Open Stack Swift
documentation does not prescribe encoding standards for name or
value data, so it is left up to implementors to choose their own
strategy.

@param array $headers
An associative array of HTTP headers.
@param string $prefix
The prefix on metadata headers.
@retval array
@return array
An associative array of name/value attribute pairs.
Extract object attributes from HTTP headers .