Q:

Comparing Multidimensional arrays in PHP

I am trying to compare to multidimensional arrays, but I can't just use array_diff_assoc().  The arrays I am trying to compare are both associative arrays, and they are both sorted so the keys are in the same order.  For the most part the arrays are identical in structure.  I can't seem to figure out how to compare the elements that store arrays, I can compare the elements that hold one value just fine does anyone know what I can do?

A:

If your trying to just see if they are different (and not what specifically is different) you could try something like:
 return serialize($array1) == seralize($array2);

That would give you a yea or neah on the equality of the two arrays.

A:

There's a user contributed note on the manual page for array_diff_assoc() that seems like it does what you're asking for.

