Q:

Finding multi dimensional array value that doesnt match

I have two multi dimensional arrays. Both arrays are almost identical except one of them has a value that doesn't exist in the other. The arrays I"m working with are:
Array1
Array
(
    [0] => Array
        (
            [dexcode] => BeS712210
        )

    [1] => Array
        (
            [dexcode] => De 48245
        )

    [2] => Array
        (
            [dexcode] => All50481
        )

    [3] => Array
        (
            [dexcode] => Bis1016338
        )

    [4] => Array
        (
            [dexcode] => S-T41471
        )

    [5] => Array
        (
            [dexcode] => Ron35844
        )

    [6] => Array
        (
            [dexcode] => Lin10961
        )

    [7] => Array
        (
            [dexcode] => Tip295926
        )

    [9] => Array
        (
            [dexcode] => SLN893827
        )

    [10] => Array
        (
            [dexcode] => Fen1016241
        )

    [11] => Array
        (
            [dexcode] => Aut331661
        )

    [12] => Array
        (
            [dexcode] => Pro39613
        )

    [13] => Array
        (
            [dexcode] => Com920158
        )

    [14] => Array
        (
            [dexcode] => Sma21322
        )

    [15] => Array
        (
            [dexcode] => Bev121157
        )

    [16] => Array
        (
            [dexcode] => Cit3043324
        )

    [17] => Array
        (
            [dexcode] => Que2182100
        )

)

Array2:
Array
(
    [0] => Array
        (
            [dexcode] => BeS712210
        )

    [1] => Array
        (
            [dexcode] => De 48245
        )

    [2] => Array
        (
            [dexcode] => All50481
        )

    [3] => Array
        (
            [dexcode] => Bis1016338
        )

    [4] => Array
        (
            [dexcode] => S-T41471
        )

    [5] => Array
        (
            [dexcode] => Ron35844
        )

    [6] => Array
        (
            [dexcode] => Lin10961
        )

    [7] => Array
        (
            [dexcode] => Tip295926
        )

    [9] => Array
        (
            [dexcode] => SLN893827
        )

    [10] => Array
        (
            [dexcode] => Fen1016241
        )

    [11] => Array
        (
            [dexcode] => Aut331661
        )

    [12] => Array
        (
            [dexcode] => Pro39613
        )

    [13] => Array
        (
            [dexcode] => Com920158
        )

    [14] => Array
        (
            [dexcode] => Sma21322
        )

    [15] => Array
        (
            [dexcode] => Bev121157
        )

    [16] => Array
        (
            [dexcode] => Que2182100
        )

)

The value that doesnt match:
[16] => Array
    (
        [dexcode] => Cit3043324
    )

With PHP I tried to get the value that doesnt match like this:
$a1 =array_unique($all_codes,SORT_REGULAR);

$a2 =array_unique($matches,SORT_REGULAR);

$results = check_diff_multi($a1, $a2);

function check_diff_multi($array1, $array2){
    $results = array();
    foreach($array1 as $key => $val) {
         if(isset($array2[$key])){
           if(is_array($val) && $array2[$key]){
               $result[$key] = check_diff_multi($val, $array2[$key]);
           }
       } else {
           $results[$key] = $val;
       }
    }

    return array_unique($results,SORT_REGULAR);
}

$a1 is the first array that I posted above which contains the different value.
$a2 is the second one.
the different values should be added to the $results variable. 
When i check what's in $results like this:
print '<pre>';
print_r($results);
print '</pre>'; 

I get this result:
Array
(
    [17] => Array
        (
            [dexcode] => Que2182100
        )

)

It seems to pick the last value only. Does anyone know why this is happening?

A:

Use array_column and array_diff functions
$arr1 = array_column($arr1, 'dexcode');
$arr2 = array_column($arr2, 'dexcode');
print_r(array_diff($arr1, $arr2));

demo

