I have this source array(): $source[] My goal is to reduce it so that i get only 1 item where user_id & item_id are the same: $result[] The ultimate way would be to use an array_reduce, but i’ll take a foreach loop. I’ve tried this, but i get an empty array or this, but i get an array with user_id