function drush_unset_recursive

8.0.x drush.inc drush_unset_recursive(&$data, $unset_key)
6.x drush.inc drush_unset_recursive(&$data, $unset_key)
7.x drush.inc drush_unset_recursive(&$data, $unset_key)
3.x drush.inc drush_unset_recursive(&$data, $unset_key)
4.x drush.inc drush_unset_recursive(&$data, $unset_key)
5.x drush.inc drush_unset_recursive(&$data, $unset_key)
master drush.inc drush_unset_recursive(&$data, $unset_key)

Unset the named key anywhere in the provided data structure.

1 call to drush_unset_recursive()
drush_outputformat::process in commands/core/outputformat.drush.inc
Perform pre-processing and then format() the $input.

File

includes/drush.inc, line 1658
The drush API implementation and helpers.

Code

function drush_unset_recursive(&$data, $unset_key) {
  if (!empty($data) && is_array($data)) {
    unset($data[$unset_key]);
    foreach ($data as $key => $value) {
      if (is_array($value)) {
        drush_unset_recursive($data[$key], $unset_key);
      }
    }
  }
}