title: php compare multidimetional array with non matching keys and return unmatched values
body: <p>Array one:</p>
  
  <pre><code>    $arr1 = array(
          array("uid" =&gt; "cgajate"),
          array("uid" =&gt; "frankfurt9"),
          array("uid" =&gt; "ricoetc")
          );
  </code></pre>
  
  <p>Array two:</p>
  
  <pre><code>    $arr2 = array(
          array("uxid" =&gt; "cgajate"),
          array("uxid" =&gt; "ricoetc"),
          array("uxid" =&gt; "ricoetc1"),
          array("uxid" =&gt; "frankfurt9"),
          array("uxid" =&gt; "panterafan")
          );
  </code></pre>
  
  <p>I have two multidimensional array (that as you can see above, do not share the same key name for the id, uxid vs uid). I am trying to find unmatched array on basis of comparing 'uid' and 'uxid' values and my expected result is:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [uxid] =&gt; ricoetc1
          )
      [1] =&gt; Array
          (
              [uxid] =&gt; panterafan
          )
  )
  </code></pre>
  
  <p>Below is my code,I am trying to find matched value and remove from result array but when I am printing give me empty array.</p>
  
  <pre><code>  $tmpArray = array();
     foreach($arr1 as $data1) {
      $duplicate = false;
       foreach($arr2 as $data2) {
          if($data1['uid'] === $data2['uxid']) $duplicate = true;
        }
       if($duplicate === false) $tmpArray[] = $data1;
     }
     echo "&lt;pre&gt;", print_r($tmpArray);
  </code></pre>