I have this multidimensional array
$liste = [[1,2,3],5,[['x','y','z'],true]];
and I want to change it to one dimensionel array
$liste = [1,2,3,5,'x','y','z',true];
so i always have a problem that give me the same shape
function to_array($list){
$out=[];
if(!is_array($list)){
return $list;
}else{
foreach($list as $line){
$out[]= to_array($line);
}
}
return $out;
}
where is the problem in this recursive function !!!