array_unique with two arrays

前端 未结 3 1518
耶瑟儿~
耶瑟儿~ 2021-01-27 07:04

I have two arrays of the same length ($search_type, $search_term). I want to remove any duplicates in the sense of there being searches that have the same type and

3条回答
  •  囚心锁ツ
    2021-01-27 07:36

    Try either array_intersect() which will take two arrays and return an array where a value in array A exists in array B. Or array_diff() which does the opposite and returns an array of all values in A that don't exist in B.

提交回复
热议问题