public function flatten($collection=null, $shallow=null) {
    list($collection, $shallow) = self::_wrapArgs(func_get_args(), 2);
    
    $collection = self::_collection($collection);
    
    $return = array();
    if(count($collection) > 0) {
      foreach($collection as $item) {
        if(is_array($item)) {
          $__ = new self;
          $return = array_merge($return, ($shallow) ? $item : $__->flatten($item));
        }
        else $return[] = $item;
      }
    }
    return self::_wrap($return);
  }
public function flatten($collection=null, $shallow=null) {
    list($collection, $shallow) = self::_wrapArgs(func_get_args(), 2);
    
    $collection = self::_collection($collection);
    
    $return = array();
    if(count($collection) > 0) {
      foreach($collection as $item) {
        if(is_array($item)) {
          $__ = new self;
          $return = array_merge($return, ($shallow) ? $item : $__->flatten($item));
        }
        else $return[] = $item;
      }
    }
    return self::_wrap($return);
  }
public function flatten ( $ collection = null , $ shallow = null ) { list ( $ collection , $ shallow ) = self :: _wrapArgs ( func_get_args ( ) , 2 ) ; $ collection = self :: _collection ( $ collection ) ; $ return = array ( ) ; if ( count ( $ collection ) > 0 ) { foreach ( $ collection as $ item ) { if ( is_array ( $ item ) ) { $ __ = new self ; $ return = array_merge ( $ return , ( $ shallow ) ? $ item : $ __ -> flatten ( $ item ) ) ; } else $ return [ ] = $ item ; } } return self :: _wrap ( $ return ) ; }
Flattens a multidimensional array
Flattens a multidimensional array