/**
     * 二维数组根据key去重复
     * @param $arr
     * @param $key
     * @return array
     */
    function arrayUniqueness($arr,$key){
        $res = array();
        foreach ($arr as $value) {
            //查看有没有重复项
            if(isset($res[$value[$key]])){
                //有:销毁
                unset($value[$key]);
            }
            else{
                $res[$value[$key]] = $value;
            }
        }
        return $res;
    }

相关文章:

  • 2021-06-15
  • 2022-01-22
  • 2021-09-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案