我有两个这样的数组
Array
(
[0] => 1
[1] => 3
[2] => 4
[3] => 5
)
Array
(
[0] => Array
(
[1] => Test1
[2] => Location1
[3] => Email1
[4] => Name1
[5] => Address1
[6] => Age1
[7] => Gender1
[8] => Phone1
[9] => Website1
[10] => Cell1
)
[1] => Array
(
[1] => Test2
[2] => Location2
[3] => Email2
[4] => Name2
[5] => Address2
[6] => Age2
[7] => Gender2
[8] => Phone2
[9] => Website2
[10] => Cell2
)
[2] => Array
(
[1] => Test3
[2] => Location3
[3] => Email3
[4] => Name3
[5] => Address3
[6] => Age3
[7] => Gender3
[8] => Phone3
[9] => Website3
[10] => Cell3
)
)
现在我必须从每个第二个数组中选择 1、3、4 和 5 个索引值。如果没有两个循环,我怎么能做到这一点。我知道我必须使用一个,但我不想使用两个循环
需要输出
Array
(
[0] => Array
(
[1] => Test1
[3] => Email1
[4] => Name1
[5] => Address1
)
[1] => Array
(
[1] => Test2
[3] => Email2
[4] => Name2
[5] => Address2
)
[2] => Array
(
[1] => Test3
[3] => Email3
[4] => Name3
[5] => Address3
)
)