当前,如果我这样做:
$array1 = [27476, 29173, 24551, 21109, 29754, 19116, 25924, 27406, 26878, 20866, 32889, 25975];
$array2 = [25959, 26427, 26775, 24968, 24501, 27218, 27441, 27353, 25074, 27344, 26794, 25355];
$data = array_merge(
array_merge_recursive(
$array1,
$array2
)
);
我明白了:
array3 = [
0: 25959
1: 26427
2: 26775
3: 24968
4: 24501
5: 27218
6: 27441
7: 27353
8: 25074
9: 27344
10: 26794
11: 25355
12: 27476
13: 29173
14: 24551
15: 21109
16: 29754
17: 19116
18: 25924
19: 27406
20: 26878
21: 20866
22: 32889
23: 25975
];
是否可以像以下那样合并它?:
array3 = [
0 => [27476, 25959]
1 => [29173, 26427]
2 => [24551, 26775]
.
.
.
.
];
我想要没有迭代,可能使用不熟悉的php7 +。
将寻求任何帮助。
答案 0 :(得分:7)