array_intersect_uassoc(): intersection between two arrays considering additional key checks through callback functionThis function takes two or more arrays as input and then returns the result array as intersection considering both values and keys.
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 present in $array2 considering keys also.
Example with two arrays
Output is here.
Keys of the first index are retained. ( no re-indexing done here) .
This article is written by plus2net.com team.