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.

2 calls to drush_unset_recursive()
drush_sql_conf in commands/sql/sql.drush.inc
Command callback. Displays the Drupal site's database connection string.
_drush_sitealias_print_record in commands/core/sitealias.drush.inc
Given a site alias name, print out a php-syntax representation of it.

File

includes/drush.inc, line 2928
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);
      }
    }
  }
}