You are here

function _simplenews_flatten_array in Simplenews 6

Same name and namespace in other branches
  1. 6.2 simplenews.module \_simplenews_flatten_array()

Flatten a nested array

1 call to _simplenews_flatten_array()
simplenews_nodeapi in ./simplenews.module
Implementation of hook_nodeapi().

File

./simplenews.module, line 2322
Simplnews node handling, sent email, newsletter block and general hooks

Code

function _simplenews_flatten_array($array) {
  $return = array();
  foreach ($array as $key => $value) {
    if (is_array($value)) {
      $return += _simplenews_flatten_array($value);
    }
    else {
      $return[$key] = $value;
    }
  }
  return $return;
}