drupal_attributes
- Versions
- 4.6 – 6
drupal_attributes($attributes = array())- 7
drupal_attributes(array $attributes = array())
Format an attribute string to insert in a tag.
Parameters
$attributes An associative array of HTML attributes.
Return value
An HTML string ready for insertion in a tag.
Related topics
Code
includes/common.inc, line 1528
<?php
function drupal_attributes($attributes = array()) {
if ($attributes) {
$t = array();
foreach ($attributes as $key => $value) {
$t[] = $key .'="'. check_plain($value) .'"';
}
return ' '. implode($t, ' ');
}
}
?>Login or register to post comments 