function reduceArray($array) {
$return = [];
array_walk_recursive($array,
function ($x) use (&$return)
{ $return[] = $x; }
);
return $return;
}