首页 > 代码库 > php如何去掉二维数组中重复的元素

php如何去掉二维数组中重复的元素

$arr=array(
"1"=>array("a","b "),
"2"=>array("a","c"),
"3"=>array("a","b")
);
实现结果:
$arr=array(
"1"=>array("a","b "),
"2"=>array("a","c"),
);

function remove_duplicate($array){
$result=array();
for($i=0;$i<count($array);$i++){
$source=$array[$i];
if(array_search($source,$array)==$i && $source<>"" ){
$result[]=$source;
}
}
return $result;
}

php如何去掉二维数组中重复的元素