What is a simple mode, in PHP, to remove all the sub arrays of a multidimensional array? What I want is to remove all the sub arrays but the top one...
Thanks, titel
What is a simple mode, in PHP, to remove all the sub arrays of a multidimensional array? What I want is to remove all the sub arrays but the top one...
Thanks, titel
foreach($array as $k => $a) {
if (is_array($a)) { unset($array[$k]); }
}
Like this?
function FlattenCallback($Value) { return !is_array($Value); }
$OneDimension = array_filter($MultiDimension, 'FlattenCallback');