title: compare two arrays and unset any matching pairs from the arrays with php?
body: <p>I am pretty new with arrays and multi-dimensional arrays, and am wondering how to go about comparing the key=>value pairs of two arrays (or a single array with two different keys that contain arrays?) and unset the key=>value pairings from each array that match keys and value.</p>
  
  <p><strong>Example Array:</strong></p>
  
  <pre><code>Array
  (
      [from] =&gt; Array
          (
              [active] =&gt; 1
              [airport_ids] =&gt; 
              [group_name] =&gt; test adgrp
              [zone_id] =&gt; 12
              [creation_time] =&gt; 1234567890
          )
  
      [to] =&gt; Array
          (
              [active] =&gt; 1
              [airport_ids] =&gt; 
              [group_name] =&gt; test adgroup
              [zone_id] =&gt; 2
              [group_email] =&gt; test@group.com
          )
  
  )
  </code></pre>
  
  <p>So, <code>from</code> is the base key array and <code>to</code> is the comparison key array.
  I want to iterate through both <code>to</code> and <code>from</code> key arrays, finding matching keys, and comparing the values of the two matches. </p>
  
  <p>If they key=>value pair matches, unset the key=>value from both <code>to</code> and <code>from</code> key arrays.</p>
  
  <p>if there is a key found in <code>to</code> that is not in <code>from</code>, leave it in the <code>to</code> array. However, if there is a key found in <code>from</code> that is not found in <code>to</code>, unset it from the <code>from</code> key array.</p>
  
  <p>Turning the above array into something like this:</p>
  
  <pre><code>Array
  (
      [from] =&gt; Array
          (
              [group_name] =&gt; test adgrp
              [zone_id] =&gt; 12
          )
  
      [to] =&gt; Array
          (
              [group_name] =&gt; test adgroup
              [zone_id] =&gt; 2
              [group_email] =&gt; test@group.com
          )
  
  )
  </code></pre>