How to remove duplicate values from a multidimensional array?
I have array data from two separate mysql queries. Array data looks like below: 0 : {user_id: 82, ac_type: 1,…} 1 : {user_id: 80, ac_type: 5,…} 2 : {user_id: 76, ac_type: 1,…} 3 : {user_id: 82, ac_type: 1,…} 4 : {user_id: 80, ac_type: 5,…} I want to remove the duplicate array items. So, my output will be like this: 0 : {user_id: 82, ac_type: 1,…} 1 : {user_id: 80, ac_type: 5,…} 2 : {user_id: 76, ac_type: 1,…} I want to check duplicate by user_id. I have tried the following solutions, but neither are not working as desired. $input = array_unique($res, SORT_REGULAR); $input = array_map(