PHP 去除一维,二维数组重复value的键

    xiaoxiao2021-03-26  42

    二维数组去除重复value的键 private function array_unique_fb($origin){ foreach ($origin as $key => $v){ $v = json_encode($v); $temp[$key] = $v; } $temp = array_unique($temp); foreach ($temp as $k => $val){ $temp[$k] =json_decode($val,true); } return $temp; } 一维数组直接 array_unique就好了
    转载请注明原文地址: https://ju.6miu.com/read-450026.html

    最新回复(0)