You are here

function Utils::wf_crm_array2str in Webform CiviCRM Integration 8.5

Convert an array into a | separated string

Parameters

array $arr: Array of select options

Return value

string String representation of key => value select options

Overrides UtilsInterface::wf_crm_array2str

File

src/Utils.php, line 619
Webform CiviCRM module's common utility functions.

Class

Utils

Namespace

Drupal\webform_civicrm

Code

function wf_crm_array2str($arr) {
  $str = '';
  foreach ($arr as $k => $v) {
    $str .= ($str ? "\n" : '') . $k . '|' . $v;
  }
  return $str;
}