PHP Function Array_Udiff_ASSOC
The php function array_udiff_assoc compares the keys and values of an array against one or more other arrays and returns the differences. It is similar to the function array_diff but uses a user defined comparison function instead of an internal function for comparing the data.
It is a pretty handy function to have in your toolbox, as it is highly customizable and flexible. It allows you to compare arrays in a more detailed and specific way. It also has the advantage that it is faster than other compared functions.
There are many built in php functions to work with arrays, but the udiff_assoc is perhaps one of the most useful ones. It provides an easy and quick way to compare arrays in a more detailed way, allowing you to check for elements that are either missing or present in both arrays.
This function differs from array_diff in that it uses a callback function for comparison of data rather than an internal function. The comparison function must return an integer less than, equal to or greater than zero if the first argument is considered to be respectively less than, equal to or greater than the second argument.
It only checks one dimension of a n-dimensional array, so if you are looking to compare multiple dimensions then you will need to use a combination of these functions. For example array_udiff_assoc($array1[0], $array2[0], $array3[0]);. You can find more about this function in the PHP manual by clicking here.