title: Compare two multidimensional Associative arrays
body: <p>I've been trying to get this for hours now.
  I have two multidimensional arrays.</p>
  
  <pre><code>$newData (
  [0] =&gt; Array(
      [id] =&gt; 1
      [name] =&gt; John
      [sex] =&gt; male
  )
  [1] =&gt; Array(
      [id] =&gt; 2
      [name] =&gt; Kenny
      [sex] =&gt; male
  )
  [2] =&gt; Array(
      [id] =&gt; 3
      [name] =&gt; Sarah
      [sex] =&gt; female
  )
  [3] =&gt; Array(
      [id] =&gt; 4
      [name] =&gt; George
      [sex] =&gt; male
  )
  )
  
  $oldData (
  [0] =&gt; Array(
      [id] =&gt; 3
      [name] =&gt; Sarah
      [sex] =&gt; female
  )
  [1] =&gt; Array(
      [id] =&gt; 4
      [name] =&gt; George
      [sex] =&gt; male
  )
  [2] =&gt; Array(
      [id] =&gt; 5
      [name] =&gt; Peter
      [sex] =&gt; male
  )
  [3] =&gt; Array(
      [id] =&gt; 6
      [name] =&gt; Lexi
      [sex] =&gt; female
  )
  )
  </code></pre>
  
  <p>If name in <code>$oldData</code> is matched with <code>$newData</code> I need to fetch the id of that array without using more loops</p>