drupal_attributes($attributes = array())
drupal/includes/common.inc, line 1528
Format an attribute string to insert in a tag.
$attributes An associative array of HTML attributes.
An HTML string ready for insertion in a tag.
| Name | Description |
|---|---|
| Input validation | Functions to validate user input. |
function drupal_attributes($attributes = array()) {
if ($attributes) {
$t = array();
foreach ($attributes as $key => $value) {
$t[] = $key .'="'. check_plain($value) .'"';
}
return ' '. implode($t, ' ');
}
}