php数组去除重复数据生成新数组


$filter_data = array();
$filter_data = array_flip(array_flip($filter_data));
$new_filter_data = array();
    foreach ($filter_data as $k => $v) {
        if($v==''){
            unset($filter_data[$k]);
        }
        $new_filter_data[] = $filter_data[$k];
    }

你可能感兴趣的:(php数组去除重复数据生成新数组)