How can I merge the second and the third, the fourth and the fifth, the sixth and the seventh, ... values of a 2-dimensional array? The first array [number] should not be merged:
Array
(
[number] => Array
(
[0] => 1234
[1] => 2345
[2] => 3456
)
[vote01] => Array
(
[0] => 000
[1] => 000
[2] => 001
)
[vote02] => Array
(
[0] => 002
[1] => 002
[2] => 003
)
[vote03] => Array
(
[0] => 004
[1] => 004
[2] => 005
)
[vote04] => Array
(
[0] => 006
[1] => 007
[2] => 008
)
...
)
merged to:
Array
(
[number] => Array
(
[0] => 1234
[1] => 2345
[2] => 3456
)
[new01] => Array
(
[0] => 000
[1] => 000
[2] => 001
[3] => 002
[4] => 002
[5] => 003
)
[new02] => Array
(
[0] => 004
[1] => 004
[2] => 005
[3] => 006
[4] => 007
[5] => 008
)
...
)
I need somehow combine the array_merge_recursive()
function and the foreach
loop...