In PHP, array_uintersect_assoc() returns the entries of the first array that exist in all other arrays, comparing keys exactly and values with a custom function.
An entry is kept only when the same key exists in every other array and your callback says the values are equal.
Syntax
Call array_uintersect_assoc() with the values you need. Start with this line.
Each round stores a score for each player by name.
The callback turns the scores into integers and compares them.
ann and cara have the same score in both rounds, but ben changed from 75 to 80.
array_keys() lists the players who stayed the same.
Frequently Asked Questions
It returns the entries of the first array that appear in every other array with the same key and an equal value, where equality of values is decided by your callback.
array_uintersect() ignores keys. array_uintersect_assoc() also requires the key to match.
No. Keys are compared exactly. Use array_uintersect_uassoc() if you need a custom key comparison.
Values and keys come from the first array.
An integer: negative, zero or positive. Zero means the values are equal.