drupal_implode_tags

Versions
6 – 7
drupal_implode_tags($tags)

Implode an array of tags into a string.

Code

includes/common.inc, line 3657

<?php
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);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.