You are here

function _radioactivity_prune_array in Radioactivity 6

Same name and namespace in other branches
  1. 5 radioactivity.module \_radioactivity_prune_array()
1 call to _radioactivity_prune_array()
radioactivity_admin_profile_form_submit in ./radioactivity-admin-ui.inc

File

./radioactivity-admin-ui.inc, line 244
Radioactivity core admin UI.

Code

function _radioactivity_prune_array($energy) {
  $ret = array();
  if (isset($energy) && count($energy)) {
    foreach ($energy as $key => $value) {
      if (is_array($value)) {
        $value = _radioactivity_prune_array($value);
      }
      if ($value || !is_array($value) && strlen($value)) {
        $ret[$key] = $value;
      }
    }
  }
  return $ret;
}