php数组去除重复数据生成新数组
程序员文章站
2022-06-11 14:44:35
...
<!-- 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];
}
转载于:https://my.oschina.net/u/585932/blog/85265