Last active
August 29, 2015 14:18
-
-
Save dellow/d0f89977a1d6c9cd6319 to your computer and use it in GitHub Desktop.
Flattens any array.
This file contains hidden or 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
/** | |
* array_flatten | |
* Flattens any array. | |
* | |
* @since 1.0.0 | |
* @version 1.0.0 | |
**/ | |
function array_flatten($array){ | |
$return = array(); | |
array_walk_recursive($array, function($a) use (&$return) { $return[] = $a; }); | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment