array(array(10, 20), array(30, 40))
array(10, 20, 30, 40)
/**
* Collapse an array of arrays into a single array.
*
* @param array $array
* @return array
*/
function array_collapse($array)
{
$results = [];
foreach ($array as $values) {
if (! is_array($values)) {
continue;
}
$results = array_merge($results, $values);
}
return $results;
}