PHP array_udiff() Function

Computes the difference of arrays by using a callback function for data comparison. This is unlike array_diff() which uses an internal function for comparing the data.array_udiff — Computes the difference of arrays by using a callback function for data comparison.Compare the values of two arrays (use a user-defined function to compare the values) and return the differences:

Example -

Example -