Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 361 Bytes

flatten.md

File metadata and controls

24 lines (16 loc) · 361 Bytes

flatten

Description

Flat a multidimensional collection

Parameters

coll
Collection of multiples dimensions.

Examples

Flat a nested array of numbers:

<?php

use function Lambdish\Phunctional\flatten;

return flatten([1, [2, 3], [4, [5, 6], [[[[[7, 8]]]]]]]);
            
// => [1, 2, 3, 4, 5, 6, 7, 8]