You are here

function fuzzysearch_unique in Fuzzy Search 7

Same name and namespace in other branches
  1. 6 fuzzysearch.module \fuzzysearch_unique()

Recursive array_unique().

1 call to fuzzysearch_unique()
fuzzysearch_process_excerpt in ./fuzzysearch.module
Fuzzysearch process excerpt.

File

./fuzzysearch.module, line 468
Fuzzysearch module.

Code

function fuzzysearch_unique($array) {
  $result = array_intersect_key($array, array_unique(array_map('serialize', $array)));
  foreach ($result as $key => $value) {
    if (is_array($value)) {
      $result[$key] = fuzzysearch_unique($value);
    }
  }
  return $result;
}