<?php function array_flatten($array) { $return = array(); foreach ($array as $key => $value) { if (is_array($value)){ $return = array_merge($return, array_flatten($value));} else {$return[$key] = $value;} } return $return; } var_export(array_flatten([['a', 'b'], 'c']));
You have javascript disabled. You will not be able to edit any code.