function webform_civicrm_str2array in Webform CiviCRM Integration 6.2
Same name and namespace in other branches
- 7.2 webform_civicrm_utils.inc \webform_civicrm_str2array()
 
Convert a | separated string into an array
4 calls to webform_civicrm_str2array()
- webform_civicrm_process_submission in ./
webform_civicrm_forms.inc  - Webform submission handler Create/update CiviCRM contacts and related data Called by presave, insert and update webform hooks
 - webform_civicrm_remove_fields in ./
webform_civicrm_forms.inc  - Fields to remove.
 - _webform_civicrm_webform_component_form_alter in ./
webform_civicrm_admin.inc  - Alter back-end webform component edit forms. Called by hook_form_alter() whenever editing a webform component.
 - _webform_civicrm_webform_frontend_form_alter in ./
webform_civicrm_forms.inc  - Alter front-end of webforms: Called by hook_form_alter() when rendering a civicrm-enabled webform Add custom prefix. Display messages. Block users who should not have access. Set webform default values.
 
File
- ./
webform_civicrm_utils.inc, line 974  - Webform CiviCRM module's common utility functions. The code in this file is cross-compatible with D6/Civi3 and D7/Civi4 Drupal-version-specific functions belong in webform_civicrm_dx_functions.inc
 
Code
function webform_civicrm_str2array($str) {
  $ret = array();
  if ($str) {
    foreach (explode("\n", trim($str)) as $row) {
      list($k, $v) = explode('|', $row);
      $ret[trim($k)] = trim($v);
    }
  }
  return $ret;
}