function drush_flatten_array

8.0.x drush_flatten_array($a)
6.x drush_flatten_array($a)
7.x drush_flatten_array($a)
master drush_flatten_array($a)

Convert a nested array into a flat array. Thows away the array keys, returning only the values.

@returns array A simple list of items (e.g. array('a','b','c')


$args: An array that may potentially be nested. e.g. array('a', array('b', 'c'))

1 call to drush_flatten_array()


includes/, line 221
The drush API implementation and helpers.


function drush_flatten_array($a) {
  $result = array();
  if (!is_array($a)) {
    return array($a);
  foreach ($a as $value) {
    $result = array_merge($result, drush_flatten_array($value));
  return $result;