function drupal_explode_tags

cis7 drupal_explode_tags($tags)
cle7 drupal_explode_tags($tags)
elmsmedia7 drupal_explode_tags($tags)
icor7 drupal_explode_tags($tags)
meedjum_blog7 drupal_explode_tags($tags)
mooc7 drupal_explode_tags($tags)

Explodes a string of tags into an array.

See also


27 calls to drupal_explode_tags()
comment_unpublish_by_keyword_action_submit in modules/comment/comment.module
Process comment_unpublish_by_keyword_action_form form submissions.
custom_formatters_autocomplete in sites/all/modules/local_contrib/custom_formatters/plugins/export_ui/
Field Types autocomplete callback.
custom_formatters_field_formatter_info in sites/all/modules/local_contrib/custom_formatters/includes/
Implements hook_field_formatter_info().
custom_formatters_formatter_is_active in sites/all/modules/local_contrib/custom_formatters/custom_formatters.module
custom_formatters_insert_styles in sites/all/modules/local_contrib/custom_formatters/includes/
Implements hook_insert_styles().

... See full list


includes/, line 7408
Common functions that many Drupal modules will need to reference.


function drupal_explode_tags($tags) {
  // This regexp allows the following types of user input:
  // this, "somecompany, llc", "and ""this"" w,o.rks", foo bar
  $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x';
  preg_match_all($regexp, $tags, $matches);
  $typed_tags = array_unique($matches[1]);

  $tags = array();
  foreach ($typed_tags as $tag) {
    // If a user has escaped a term (to demonstrate that it is a group,
    // or includes a comma or quote character), we remove the escape
    // formatting so to save the term into the database as the user intends.
    $tag = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $tag)));
    if ($tag != "") {
      $tags[] = $tag;

  return $tags;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.