title: How can I compare the rows in two 2d arrays?
body: <p>It seems that every PHP function I read about for comparing arrays (<code>array_diff()</code>, <code>array_intersect()</code>, etc) compares for the <strong>existence</strong> of array elements.</p>
  <p>Given two multidimensional arrays with identical structure, how would you list the differences in <strong>values</strong>?</p>
  <h2>Example</h2>
  <h3>Array 1</h3>
  <pre>
  [User1] => Array ([public] => 1
                  [private] => 1
                  [secret] => 1
                 ) 
  [User2] => Array ([public] => 1
                  [private] => 0
                  [secret] => 0
                 )
  </pre>
  <h3>Array 2</h3>
  <pre>
  [User1] => Array ([public] => 1
                  [private] => 0
                  [secret] => 1
                 ) 
  [User2] => Array ([public] => 1
                  [private] => 0
                  [secret] => 0
                 )
  </pre>
  <h3>Difference</h3>
  <pre>
  [User1] => Array ([public] => 1
                  [private] => 0 //this value is different
                  [secret] => 1
                 )
  </pre>
  <p>So my result would be - &quot;Of all the users, User1 has changed, and the difference is that private is 0 instead of 1.&quot;</p>