Question: I have an array like this:

```
Array
(
    [0] => wahyu@email.co.id
    [1] => wahyu@email.co.id
)
Array
(
    [0] => wahyu@email.co.id
    [1] => wahyu@email.co.id
)

```

I would like to combine array above like this:

```
Array
(
    [0] => wahyu@email.co.id
    [1] => wahyu@email.co.id
    [2] => wahyu@email.co.id
    [3] => wahyu@email.co.id
)

```

How the way to combine it?

Answer: 
**array\_merge** function is used for the combine two array.

```
$a = array("0" => "one@email.co.id",
    "1" => "two@email.co.id"
);

$b = array(
    "0" => "three@email.co.id",
    "1" => "four@email.co.id"
);

$merged_array = array_merge($a,$b);

echo "<prE>";
print_r($merged_array);

```
Here is what you are looking for,

```
$array1 = [
    0 => 'wahyu@email.co.id',
    1 => 'wahyu@email.co.id',
];
$array2 = [
    0 => 'wahyu@email.co.id',
    1 => 'wahyu@email.co.id',
];
array_splice($array1, count($array1), 0, $array2);
print_r($array1);

```

[array\_splice](http://php.net/manual/en/function.array-splice.php) — Remove a portion of the array and replace it with something else

**Output:**

```
Array
(
    [0] => wahyu@email.co.id
    [1] => wahyu@email.co.id
    [2] => wahyu@email.co.id
    [3] => wahyu@email.co.id
)

```

[Demo](http://sandbox.onlinephpfunctions.com/code/01c8c073400813735b450183588ef82200808988).