drupal_http_header_attributes(array $attributes = array())
Formats an attribute string for an HTTP header.
Parameters
$attributes: An associative array of attributes such as 'rel'.
Return value
A ; separated string ready for insertion in a HTTP header. No escaping is performed for HTML entities, so this string is not safe to be printed.
File
- core/includes/common.inc, line 355
- Common functions that many Drupal modules will need to reference.
Code
1 2 3 4 5 6 7 8 9 | function drupal_http_header_attributes( array $attributes = array ()) { foreach ( $attributes as $attribute => & $data ) { if ( is_array ( $data )) { $data = implode( ' ' , $data ); } $data = $attribute . '="' . $data . '"' ; } return $attributes ? ' ' . implode( '; ' , $attributes ) : '' ; } |
Please login to continue.