Array
(
[0] => Array
(
[0] => abc
[1] => def
)
[1] => Array
(
[0] => ghi
[1] => jkl
)
[2] => Array
(
[0] => mno
[1] => pql
)
[3] => Array
(
[0] => abc
[1] => def
)
[4] => Array
(
[0] => ghi
[1] => jkl
)
[5] => Array
(
[0] => mno
[1] => pql
)
)
答案 0 :(得分:0)
array_unique($array, SORT_REGULAR);
答案 1 :(得分:0)
将使用嵌套的foreach,如下所示:
foreach ($aArray as $iPos => $aInnerArray) {
foreach ($aArray as $iPos => $aArrayToCheck) {
if($aInnerArray === $aArrayToCheck){
unset($aArray($iPos));
}
}
}
答案 2 :(得分:0)
试试此代码
//method for remove duplicate data
function removeDuplicate($arr) {
//Define output
$outputs = [];
//Define temp for keep data
$tmps = [];
foreach ($arr as $each) {
//convert to string
$tmp = implode("|", $each);
if (!in_array($tmp, $tmps)) {
$tmps[] = $tmp;
$outputs[] = $each;
}
}
return $outputs;
}