Skip to content

Tag: array-intersect

Array Intersection – only once

Newbie here, so I have a problem with the array_intersect function. I am comparing two arrays with intersection but I get some results twice. For example: 2 arrays $result = array_intersect($array1, $array2); This returns: But I want this: I want this to return apple and orange ONCE each. Currently it returns…