php數組去除重複數據生成新數組

<!-- 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];
   	}
相關文章
相關標籤/搜索