You are here

function _mailchimp_explode_interest_groups in Mailchimp 6.2

Parses interest groups into array and un-escapes commas in group names.

Parameters

string $groups:

Return value

array

1 call to _mailchimp_explode_interest_groups()
_mailchimp_interest_groups_element in ./mailchimp.module
Helper that returns interest groups form element

File

./mailchimp.module, line 1153
Mailchimp module.

Code

function _mailchimp_explode_interest_groups($groups) {

  // Split by comma that is not preceded by backslash and followed by
  // zero to one space
  $groups = preg_split('/(?<!\\\\)\\,\\s?/', $groups);
  foreach ($groups as $key => $group) {
    $groups[$key] = str_replace('\\,', ',', $group);
  }
  return $groups;
}