如何在php中组合两个多维数组,其中一个键的值相同

I have two array i want to combine it but condition's are if Val is similar and code are the exact match then combine otherwise push as it is.

Array

$Array1 = array(array("id" => 1,"val" => 'Hotel royal', "code" => '110088', ),array("id" => 2,"val" => 'Hotel Club Town', "code" => '110084', ),array("id" => 4,"val" => "Hotel Park Club ", "code" => '110088',));
$Array2 = array(array("id" => 2,"val" => 'Hotel royal delhi', "code" => '110088',),array("id" => 1,"val" => "Hotel Club's Town", "code" => '110084',),array("id" => 6,"val" => "Hotel Park Club's Delhi ", "code" => '110088',));


Want OutPut

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [id] => 1
                    [val] => Hotel royal
                    [code] => 110088
                )
            [1] => Array
                (
                    [id] => 2
                    [val] => Hotel Royal Delhi
                    [code] => 110088
                )
        )
    [1] => Array
        (
            [0] => Array
                (
                    [id] => 2
                    [val] => Hotel Club Town
                    [code] => 110084
                )
            [1] => Array
                (
                    [id] => 1
                    [val] => Hotel Club's Town
                    [code] => 110084
                )
        )
    [2] => Array
        (
            [0] => Array
                (
                    [id] => 4
                    [val] => Hotel Park Club 
                    [code] => 110088
                )
            [1] => Array
                (
                    [id] => 6
                    [val] => Hotel Park Club's Delhi 
                    [code] => 110088
                )
        )
)


I have tried this code

foreach ($Array1 as $key => $value) {
    foreach ($Array2 as $value2) {
        if ($value['id'] == $value2['id']) {
            $array_new[$key] = array($value,$value2);
        }
        elseif (!$value['id'] == $value2['id']) {
            $array_new[$key] = array($value,$value2);
        }
    }
}

but this code is not returning desire output.

Both array require the same proccesing, so you can merge them in one loop

$res = array();
foreach (array_merge($Array1,$Array2)  as $value) 
    $res[$value['id']][] =  $value;

print_r($res);

demo

If you want regular array, just set after loop $res = array_values($res);