我有一个如下数组,其中包含不同数量的顶级数组:
Array
(
[1534] => Array
(
[userid] => 1534
[a1] => 3
[a2] => 6
[a3] => 5
[groupID] => 2
[total] => 109
)
[1535] => Array
(
[userid] => 1535
[a1] => 6
[a2] => 4
[a3] => 1
[groupID] => 2
[total] => 125
)
)
除了 foreach 之外,还有其他选择吗:
Array
{
[userid] => Array
(
[1534] => 1534
[1535] => 1535
)
[a1] => Array
(
[1534] => 3
[1535] => 6
)
[a2] => Array
(
[1534] => 6
[1535] => 4
)
[a3] => Array
(
[1534] => 5
[1535] => 1
)
[groupID] => Array
(
[1534] => 2
[1535] => 2
)
[total] => Array
(
[1534] => 109
[1535] => 125
)
)
? 目的是遍历输出中表的每一行的新数组