阵列:
itemA => value
itemA1 => value
itemA2 => value
itemA11 => value
itemB => value
and so on...
如何获得这样收集的值:
[0] => value (from itemA)
[1] => value (from itemA1)
[2] => value (from itemA2)
[3] => value (from itemA11)
[4] => value (from itemB)
...
答案 0 :(得分:4)
使用array_walk()编写自己的数组函数? 或者,我不知道,但也许使用array_values()?编辑:我发现了这个:
$a = array(1,2,array(3,4, array(5,6,7), 8), 9);
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($a));
foreach($it as $v) {
echo $v, " ";
}