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


20 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.
entityreference_autocomplete_callback_get_matches in sites/all/modules/ulmus/entityreference/entityreference.module
Return JSON based on given field, instance and string.
masquerade_admin_settings_validate in sites/all/modules/ulmus/masquerade/masquerade.module
masquerade_autocomplete_multiple in sites/all/modules/ulmus/masquerade/masquerade.module
Returns JS array for Masquerade autocomplete fields.
masquerade_update_6003 in sites/all/modules/ulmus/masquerade/masquerade.install
Change masquerade_quick_switches variable to store a serialized array of user ID's. Reverts update 6001.

... 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.