array_udiff(): Difference between two arrays comparing values through callback functionThis function takes two or more arrays as input and then returns the result array as difference.
my_function() : is the callback function to return integer less than , equal to or greater than zero after comparing the keys.
Returns all elements of $array1 which are not present in $array2 considering keys. Keys comparison is done through call-back function my_function().
Example with two arrays
Output is here.
Keys of the first index are retained. ( no re-indexing done here) . The element with value Third is not included in output as the value is matching with $second array.
This article is written by plus2net.com team.