You are here

function array2str in Search Autocomplete 7.3

Same name and namespace in other branches
  1. 7.2 search_autocomplete.form.treelist.inc \array2str()

This function transforms the choices into a string.

File

./search_autocomplete.form.treelist.inc, line 116
Search Autocomplete Display the list of form to autocomplete and themis it as a draggable table.

Code

function array2str($myarray, &$output = '', $parentkey = "---") {
  foreach ($myarray as $key => $value) {
    if (is_array($value)) {
      $parentkey .= "---";
      array2str($value, $output, $parentkey);
      $parentkey = substr($parentkey, 0, -3);
    }
    else {
      $output .= $parentkey . "[" . $key . "] => " . $value . "<br/>";
    }
  }
  return $output;
}