<!-- lang: 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]; }