Last active
June 16, 2017 05:28
-
-
Save elvismdev/2566038f71370b2b78de15688e7e5e31 to your computer and use it in GitHub Desktop.
De-chunks an array, opposite of array_chunk() http://php.net/manual/en/function.array-chunk.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function array_dechunk( $array ) { | |
return array_reduce( $array, function ( $carry, $item ) { | |
return array_merge( $carry, $item ); | |
}, [] ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment