This can be done by array.splice(). Please note array_splice or array_merge doesn't preserve keys for associative arrays. So array_slice is used and '+' operator is used for concatenating the two arrays. More details [here][1] ```php $array_1 = array( '0' => 'zero', '1' => 'one', '2' => 'two', '3' => 'three', ); $array_2 = array( 'zero' => '0', 'one' => '1', 'two' => '2', 'three' => '3', ); $index = 2; $finalArray = array_slice($array_1, 0, $index, true) + $array2 + array_slice($array_2, $index, NULL, true); print_r($finalArray); /* Array ( [0] => zero [1] => one [10] => grapes [z] => mangoes [two] => 2 [three] => 3 ) */ ``` [1]: https://www.php.net/manual/en/function.array-splice.php