title: array_diff() based on one column between two arrays with associative rows
body: <p>I have two multidimensional arrays which are indexed arrays of associative rows.</p>
  <pre><code>$array1 = array(
      array('name' =&gt; 'foo', 'id' =&gt; 12),
      array('name' =&gt; 'bar', 'id' =&gt; 34),
      array('name' =&gt; 'boo', 'id' =&gt; 56),
  );
  
  $array2 = array(
      array('name' =&gt; 'bar', 'id' =&gt; 34),
      array('name' =&gt; 'boo', 'id' =&gt; 56),
      array('name' =&gt; 'bar', 'id' =&gt; 78),
  );
  </code></pre>
  <p>It is possible that rows might have different <code>id</code> values but the same <code>name</code> value -- such as <code>bar</code> in my sample input data.</p>
  <p>I need to compare the arrays based on <code>id</code> values only.</p>
  <p>Expected Output: (because <code>id</code>s <code>34</code> and <code>56</code> are found in <code>$array2</code>)</p>
  <pre><code>array(
      array('name' =&gt; 'foo', 'id' =&gt; 12)
  )
  </code></pre>
  <p>I tried <code>$one_not_two = array_diff($array1['id'], $array2['id']);</code> which does not return anything.</p>
  <p>I also tried <code>$one_not_two = array_diff($array1['id'], $array2['id']);</code><br />
  which returned an error &quot;argument is not an array.&quot;</p>
  <p>Originally, I got around it by extracting the <code>id</code>s into a one-dimensional array, then just comparing those.  Now a new feature in our application requires me to compare the rows while maintaining the multidimensional structure. Any advice?</p>
  <p>Our servers are currently running php 5.3 if that makes any difference.</p>