Opposite of array_intersect?
问题 Is there a built-in function to get all members of array 1 which do not exist in array 2? I know how to do it programatically, only wondering if there is a built-in function that does the same. So please, no code examples. 回答1: That sounds like a job for array_diff. Returns an array containing all the entries from array1 that are not present in any of the other arrays. 回答2: array_diff is definitely the obvious choice but it is not technically the opposite of array interesect. Take this