How to compare 2 arrays and push new values.

Perhaps the title is wrong, but i did not know what to write, i hope it is okay.

This is my first array. It contains european zipcode and how many members there is in the zipcode

Array1 called $Memcooltransactions

```
    Array ( 
[0] => Array ( [zipcode] => 1067 [city] => Copenhagen K [numberofuniqmembers] => 11 ) 
[1] => Array ( [zipcode] => 0100 [city] => Tórshavn [numberofuniqmembers] => 1 )
)

```

This is my second array. It also contains european zipcode and how many restaurants there is in the zipcode

Array2 called $Rescooltransactions

```
Array ( 
[0] => Array ( [zipcode] => 1067 [city] => Copenhagen K [numberofuniqplaces] => 1) 
[1] => Array ( [zipcode] => 1074 [city] => København V [numberofuniqplaces] => 1 )
)

```

This is my code to compare these arrays together.

```
foreach ($Memcooltransactions as $key) 
{
    $uniqmember = $key['numberofuniqmembers'];

  foreach ($Rescooltransactions as $key2) 
  {
    $uniqres = $key2['numberofuniqspisesteder'];

    if($key['zipcode'] === $key2['zipcode'])
    {

        $samlet = $uniqmember/$uniqres;
        $sizeofuniqmem += $uniqmember;
        $sizeofuniqres += $uniqres;

        $array1[] = array(
        'zipcode' => $key['zipcode'],
        'city' => $key['city'],
        'numberofuniqmembers' => $uniqmember,
        'numberofuniqspisesteder' => $uniqres, 
        );  

    }
  }
}

```

My output.

```
Array (     [0] => Array ( [zipcode] => 1067 [city] => Copenhagen K [numberofuniqmembers] => 11 [numberofuniqplaces] => 1 ) 

```

When I am trying to grab the values ​​that could not compare into a new array, it crashes the site. That is why I deleted it from my foreach above. But how can I get the desired output without crashing the site?

Desired output

```
 Array ( 
[0] => Array ( [zipcode] => 1067 [city] => Copenhagen K [numberofuniqmembers] => 11 [numberofuniqplaces] => 1 ) 
[1] => Array ( [zipcode] => 0100 [city] => Tórshavn [numberofuniqmembers] => 1 [numberofuniqplaces] => 0 )
[2] => Array ( [zipcode] => 1074 [city] => København V [numberofuniqmembers] => 0 [numberofuniqplaces] => 1 )
) 

```

Hope you can help :)