dev-master
9999999-devFlatten an array.
MIT
The Development Requires
by Martin Roldan Araujo
v1.1
1.1.0.0Flatten an array.
MIT
The Development Requires
by Martin Roldan Araujo
Flatten an array.
Flatten an array., (*1)
composer require ratacibernetica/php-flatten-array
, (*2)
[ 1, [ 2 ], [[3],[[4]]]];
[1,2,3,4]
$multipleArray = [ 1, [ 2 ], [[3],[[4]]]]; $flattener = new ratacibernetica\FlattenArray($multipleArray); $flattenedArray = $flattener->flattened; // equals $flattenedArray, [1,2,3,4]); $otherFlat = $flattener->flattenArray( [1, [2], [3], [[4],[5]]] ); // equals( $otherFlat, [1,2,3,4,5]);
Tests are located in the tests
folder, and can be run with codeception, like so:, (*3)
$ codecept run unit
Flatten an array.
MIT
Flatten an array.
MIT