php compare two multidimensional array and check for duplicate
<p>I have two arrays </p>

<pre><code>$array1 = array(
    0 =&gt; array(
        'user' =&gt; 'user0',
        'id' =&gt; 'id0'
    ),
    1 =&gt; array(
        'user' =&gt; 'user1',
        'id' =&gt; 'id1'
    ),
    2 =&gt; array(
        'user' =&gt; 'user2',
        'id' =&gt; 'id2'
    )
);

$array2 = array(
    0 =&gt; array(
        'emp' =&gt; 'emp0',
        'id' =&gt; 'id3'
    ),
    1 =&gt; array(
        'emp' =&gt; 'emp1',
        'id' =&gt; 'id1'
    ),
    2 =&gt; array(
        'emp' =&gt; 'emp2',
        'id' =&gt; 'id2'
    )
);
</code></pre>

<p>i need to loop array 2 first an d give input of id from array1 to the array 1 and search whether the value of id1 from arr1 exists in array2</p>
