Array
(
[340] => Array(
[0] => 341
)
[228] => Array(
[0] => 234
[1] => 239
)
[343] => Array (
[0] => 344
[1] => 345
)
)
desired out put
array(
[0] => 340
[1] => 341
[2] => 228
[3] => 234
[4] => 239
[5] => 343
[6] => 344
[7] => 345
)
I am trying to use recursive function to get the output I have tried with a php code but not able to get desired output
$simple_array = get_exam_preference_list_array($list);
function get_exam_preference_list_array($list, $list_array = array()){
foreach($list as $key=>$pref_list){
$list_array[] = $key;
if(is_array($pref_list)){
get_exam_preference_list_array(array_flip($pref_list), $list_array);
}
}
return $list_array;
}
Please help