function drupal_implode_tags
7.x common.inc | drupal_implode_tags($tags) |
6.x common.inc | drupal_implode_tags($tags) |
Implodes an array of tags into a string.
See also
5 calls to drupal_implode_tags()
- comment_unpublish_by_keyword_action_form in drupal-7.x/
modules/ comment/ comment.module - Form builder; Prepare a form for blacklisted keywords.
- DrupalTagsHandlingTestCase::testDrupalImplodeTags in drupal-7.x/
modules/ simpletest/ tests/ common.test - Implode a series of tags.
- node_unpublish_by_keyword_action_form in drupal-7.x/
modules/ node/ node.module - Generates settings form for node_unpublish_by_keyword_action().
- TaxonomyTermTestCase::testNodeTermCreationAndDeletion in drupal-7.x/
modules/ taxonomy/ taxonomy.test - Test term creation with a free-tagging vocabulary from the node form.
- taxonomy_autocomplete in drupal-7.x/
modules/ taxonomy/ taxonomy.pages.inc - Page callback: Outputs JSON for taxonomy autocomplete suggestions.
File
- drupal-7.x/
includes/ common.inc, line 7436 - Common functions that many Drupal modules will need to reference.
Code
function drupal_implode_tags($tags) {
$encoded_tags = array();
foreach ($tags as $tag) {
// Commas and quotes in tag names are special cases, so encode them.
if (strpos($tag, ',') !== FALSE || strpos($tag, '"') !== FALSE) {
$tag = '"' . str_replace('"', '""', $tag) . '"';
}
$encoded_tags[] = $tag;
}
return implode(', ', $encoded_tags);
}