我有数组数组:
Array
(
[0] => "title"
[1] => Array
(
[0] => a
[1] => b
[2] => c
)
[2] => Array
(
[0] => d
[1] => e
[2] => f
)
)
我需要将一个数组插入到第一个数组中,如下所示
Array
(
[0] => "title"
[1] => Array
(
[0] => a
[1] => b
[2] => c
)
[2] => Array
(
[0] => a1
[1] => b1
[2] => c1
)
[3] => Array
(
[0] => d
[1] => e
[2] => f
)
)
我不知道怎么用array_splice()
。我以这种方式尝试过,但没有奏效。
array_splice($main_array, 2, 0 $array_to_insert)