Question: I want to merge those two arrays and get only the unique key values. Is there a php function for this? array\_merge() doesn't work.

```
Array
(
    [1] => 3
    [2] => 4
    [3] => 1

)

Array
(
    [1] => 3
    [2] => 1
    [3] => 2

)

```

**RESULT ARRAY THAT I WANT**

```
Array
(
    [1] => 1
    [2] => 2
    [3] => 3
    [4] => 4

)

```

Answer: 
```
$merged = array_unique(array_merge($array1, $array2));

```
Try this:

```
$merged = array_unique(array_merge($array1, $array2));

```