Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PHP: array_flatten - método para deixar array multidimensional com 1 dimensão apenas.
* Função para deixar uma array multidimensional em 1 índice apenas.
* @see
* @author Julio Vedovatto <>
* @param array $array
* @return array
function array_flatten(array $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
You can’t perform that action at this time.