如题所述
可以,但没有PHP自带的函数,要自己编写
$arr=array(1,2,3,4,5,array('a'=>'m','b'=>'n'),1,2,3,4,5,6,7,8);
foreach ($arr as $key=>$value){
if(!is_array($value)){
$arr2[$key]=$value;
}else{
foreach ($value as $key2=>$value2){
$arr2[][$key2]=$value2;
}
}
}
print_r(array_unique($arr2));
$arr=array(1,2,3,4,5,array('a'=>'m','b'=>'n'),1,2,3,4,5,6,7,8);
foreach ($arr as $key=>$value){
if(!is_array($value)){
$arr2[$key]=$value;
}else{
foreach ($value as $key2=>$value2){
$arr2[][$key2]=$value2;
}
}
}
print_r(array_unique($arr2));
参考资料:www.phptogether.com
温馨提示:答案为网友推荐,仅供参考