here's the solution:
$array = array
(
23 => 540,
25 => array
(
656 => array(671,680),
345 => 400
)
);
var_dump($array);
$result = array();
function fn($item, $key){
global $result;
if (!is_array($item)){
$result[] = $item;
}
}
array_walk_recursive($array, 'fn');
var_dump($result);
and the result
array
23 => int 540
25 =>
array
656 =>
array
0 => int 671
1 => int 680
345 => int 400
array
0 => int 540
1 => int 671
2 => int 680
3 => int 400